Beispiel #1
0
        public static void BuildAssertions(ClassesProcessor.ClassNode node)
        {
            ClassWrapper wrapper = node.GetWrapper();
            StructField  field   = FindAssertionField(node);

            if (field != null)
            {
                string key = InterpreterUtil.MakeUniqueKey(field.GetName(), field.GetDescriptor()
                                                           );
                bool res = false;
                foreach (MethodWrapper meth in wrapper.GetMethods())
                {
                    RootStatement root = meth.root;
                    if (root != null)
                    {
                        res |= ReplaceAssertions(root, wrapper.GetClassStruct().qualifiedName, key);
                    }
                }
                if (res)
                {
                    // hide the helper field
                    wrapper.GetHiddenMembers().Add(key);
                }
            }
        }
        public virtual void CopyEntry(string source, string path, string archiveName, string
                                      entryName)
        {
            string file = Path.Combine(GetAbsolutePath(path), archiveName);

            if (!CheckEntry(entryName, file))
            {
                return;
            }
            try
            {
                using (ZipArchive srcArchive = ZipFile.Open(source, ZipArchiveMode.Read))
                {
                    var entry = srcArchive.GetEntry(entryName);
                    if (entry != null)
                    {
                        using (var @in = new MemoryStream(entry.Open().ReadFully()).ToInputStream())
                        {
                            var @out     = mapArchiveStreams.GetOrNull(file);
                            var newEntry = @out.CreateEntry(entryName);
                            InterpreterUtil.CopyStream(@in, newEntry.Open());
                        }
                    }
                }
            }
            catch (IOException ex)
            {
                string message = "Cannot copy entry " + entryName + " from " + source + " to " +
                                 file;
                DecompilerContext.GetLogger().WriteMessage(message, ex);
            }
        }
            public ClassNode(string content_class_name, string content_method_name, string content_method_descriptor
                             , int content_method_invocation_type, string lambda_class_name, string lambda_method_name
                             , string lambda_method_descriptor, StructClass classStruct)
            {
                // lambda class constructor
                this.type        = Class_Lambda;
                this.classStruct = classStruct;
                // 'parent' class containing the static function
                lambdaInformation                                = new ClassesProcessor.ClassNode.LambdaInformation();
                lambdaInformation.method_name                    = lambda_method_name;
                lambdaInformation.method_descriptor              = lambda_method_descriptor;
                lambdaInformation.content_class_name             = content_class_name;
                lambdaInformation.content_method_name            = content_method_name;
                lambdaInformation.content_method_descriptor      = content_method_descriptor;
                lambdaInformation.content_method_invocation_type = content_method_invocation_type;
                lambdaInformation.content_method_key             = InterpreterUtil.MakeUniqueKey(lambdaInformation
                                                                                                 .content_method_name, lambdaInformation.content_method_descriptor);
                anonymousClassType = new VarType(lambda_class_name, true);
                bool is_method_reference = (content_class_name != classStruct.qualifiedName);

                if (!is_method_reference)
                {
                    // content method in the same class, check synthetic flag
                    StructMethod mt = classStruct.GetMethod(content_method_name, content_method_descriptor
                                                            );
                    is_method_reference = !mt.IsSynthetic();
                }
                // if not synthetic -> method reference
                lambdaInformation.is_method_reference      = is_method_reference;
                lambdaInformation.is_content_method_static = (lambdaInformation.content_method_invocation_type
                                                              == ICodeConstants.CONSTANT_MethodHandle_REF_invokeStatic);
            }
Beispiel #4
0
        private static bool CollapseInlinedClass14(Statement stat)
        {
            bool ret = class14Builder.Match(stat);

            if (ret)
            {
                string            class_name = (string)class14Builder.GetVariableValue("$classname$");
                AssignmentExprent assignment = (AssignmentExprent)class14Builder.GetVariableValue
                                                   ("$assignfield$");
                FieldExprent fieldExpr = (FieldExprent)class14Builder.GetVariableValue("$field$");
                assignment.ReplaceExprent(assignment.GetRight(), new ConstExprent(VarType.Vartype_Class
                                                                                  , class_name, null));
                List <Exprent> data = new List <Exprent>(stat.GetFirst().GetExprents());
                stat.SetExprents(data);
                SequenceHelper.DestroyAndFlattenStatement(stat);
                ClassWrapper wrapper = (ClassWrapper)DecompilerContext.GetProperty(DecompilerContext
                                                                                   .Current_Class_Wrapper);
                if (wrapper != null)
                {
                    wrapper.GetHiddenMembers().Add(InterpreterUtil.MakeUniqueKey(fieldExpr.GetName(),
                                                                                 fieldExpr.GetDescriptor().descriptorString));
                }
            }
            return(ret);
        }
 private void CalcReachabilitySuppPoints(int edgetype)
 {
     IterateReachability((Statement node, Dictionary <int, FastFixedSetFactory <int> .FastFixedSet
                                                      <int> > mapSets) => {
         // consider to be a support point
         foreach (StatEdge sucedge in node.GetAllSuccessorEdges())
         {
             if ((sucedge.GetType() & edgetype) != 0)
             {
                 if (mapSets.ContainsKey(sucedge.GetDestination().id))
                 {
                     FastFixedSetFactory <int> .FastFixedSet <int> setReachability = mapSets.GetOrNull(node.id
                                                                                                       );
                     if (!InterpreterUtil.EqualObjects(setReachability, mapSupportPoints.GetOrNull(node
                                                                                                   .id)))
                     {
                         Sharpen.Collections.Put(mapSupportPoints, node.id, setReachability);
                         return(true);
                     }
                 }
             }
         }
         return(false);
     }
                         , edgetype);
 }
Beispiel #6
0
 private static bool IsAssertionField(Exprent exprent, string classname, string key
                                      , bool throwInIf)
 {
     if (throwInIf)
     {
         if (exprent.type == Exprent.Exprent_Function)
         {
             FunctionExprent fparam = (FunctionExprent)exprent;
             if (fparam.GetFuncType() == FunctionExprent.Function_Bool_Not && fparam.GetLstOperands
                     ()[0].type == Exprent.Exprent_Field)
             {
                 FieldExprent fdparam = (FieldExprent)fparam.GetLstOperands()[0];
                 return(classname.Equals(fdparam.GetClassname()) && key.Equals(InterpreterUtil.MakeUniqueKey
                                                                                   (fdparam.GetName(), fdparam.GetDescriptor().descriptorString)));
             }
         }
     }
     else if (exprent.type == Exprent.Exprent_Field)
     {
         FieldExprent fdparam = (FieldExprent)exprent;
         return(classname.Equals(fdparam.GetClassname()) && key.Equals(InterpreterUtil.MakeUniqueKey
                                                                           (fdparam.GetName(), fdparam.GetDescriptor().descriptorString)));
     }
     return(false);
 }
Beispiel #7
0
        private static StructField FindAssertionField(ClassesProcessor.ClassNode node)
        {
            ClassWrapper wrapper     = node.GetWrapper();
            bool         noSynthFlag = DecompilerContext.GetOption(IFernflowerPreferences.Synthetic_Not_Set
                                                                   );

            foreach (StructField fd in wrapper.GetClassStruct().GetFields())
            {
                string keyField = InterpreterUtil.MakeUniqueKey(fd.GetName(), fd.GetDescriptor());
                // initializer exists
                if (wrapper.GetStaticFieldInitializers().ContainsKey(keyField))
                {
                    // access flags set
                    if (fd.HasModifier(ICodeConstants.Acc_Static) && fd.HasModifier(ICodeConstants.Acc_Final
                                                                                    ) && (noSynthFlag || fd.IsSynthetic()))
                    {
                        // field type boolean
                        FieldDescriptor fdescr = FieldDescriptor.ParseDescriptor(fd.GetDescriptor());
                        if (VarType.Vartype_Boolean.Equals(fdescr.type))
                        {
                            Exprent initializer = wrapper.GetStaticFieldInitializers().GetWithKey(keyField);
                            if (initializer.type == Exprent.Exprent_Function)
                            {
                                FunctionExprent fexpr = (FunctionExprent)initializer;
                                if (fexpr.GetFuncType() == FunctionExprent.Function_Bool_Not && fexpr.GetLstOperands
                                        ()[0].type == Exprent.Exprent_Invocation)
                                {
                                    InvocationExprent invexpr = (InvocationExprent)fexpr.GetLstOperands()[0];
                                    if (invexpr.GetInstance() != null && invexpr.GetInstance().type == Exprent.Exprent_Const &&
                                        "desiredAssertionStatus".Equals(invexpr.GetName()) && "java/lang/Class".Equals
                                            (invexpr.GetClassname()) && (invexpr.GetLstParameters().Count == 0))
                                    {
                                        ConstExprent cexpr = (ConstExprent)invexpr.GetInstance();
                                        if (VarType.Vartype_Class.Equals(cexpr.GetConstType()))
                                        {
                                            ClassesProcessor.ClassNode nd = node;
                                            while (nd != null)
                                            {
                                                if (nd.GetWrapper().GetClassStruct().qualifiedName.Equals(cexpr.GetValue()))
                                                {
                                                    break;
                                                }
                                                nd = nd.parent;
                                            }
                                            if (nd != null)
                                            {
                                                // found enclosing class with the same name
                                                return(fd);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(null);
        }
 public virtual void CopyFile(string source, string path, string entryName)
 {
     try
     {
         InterpreterUtil.CopyFile(new FileInfo(source), new FileInfo(Path.Combine(GetAbsolutePath(path), entryName)));
     }
     catch (IOException ex)
     {
         DecompilerContext.GetLogger().WriteMessage("Cannot copy " + source + " to " + entryName
                                                    , ex);
     }
 }
Beispiel #9
0
        public static void ClearEnum(ClassWrapper wrapper)
        {
            StructClass cl = wrapper.GetClassStruct();

            // hide values/valueOf methods and super() invocations
            foreach (MethodWrapper method in wrapper.GetMethods())
            {
                StructMethod mt         = method.methodStruct;
                string       name       = mt.GetName();
                string       descriptor = mt.GetDescriptor();
                if ("values".Equals(name))
                {
                    if (descriptor.Equals("()[L" + cl.qualifiedName + ";"))
                    {
                        wrapper.GetHiddenMembers().Add(InterpreterUtil.MakeUniqueKey(name, descriptor));
                    }
                }
                else if ("valueOf".Equals(name))
                {
                    if (descriptor.Equals("(Ljava/lang/String;)L" + cl.qualifiedName + ";"))
                    {
                        wrapper.GetHiddenMembers().Add(InterpreterUtil.MakeUniqueKey(name, descriptor));
                    }
                }
                else if (ICodeConstants.Init_Name.Equals(name))
                {
                    Statement firstData = Statements.FindFirstData(method.root);
                    if (firstData != null && !(firstData.GetExprents().Count == 0))
                    {
                        Exprent exprent = firstData.GetExprents()[0];
                        if (exprent.type == Exprent.Exprent_Invocation)
                        {
                            InvocationExprent invExpr = (InvocationExprent)exprent;
                            if (Statements.IsInvocationInitConstructor(invExpr, method, wrapper, false))
                            {
                                firstData.GetExprents().RemoveAtReturningValue(0);
                            }
                        }
                    }
                }
            }
            // hide synthetic fields of enum and it's constants
            foreach (StructField fd in cl.GetFields())
            {
                string descriptor = fd.GetDescriptor();
                if (fd.IsSynthetic() && descriptor.Equals("[L" + cl.qualifiedName + ";"))
                {
                    wrapper.GetHiddenMembers().Add(InterpreterUtil.MakeUniqueKey(fd.GetName(), descriptor
                                                                                 ));
                }
            }
        }
Beispiel #10
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is IfExprent))
            {
                return(false);
            }
            IfExprent ie = (IfExprent)o;

            return(InterpreterUtil.EqualObjects(condition, ie.GetCondition()));
        }
Beispiel #11
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is SwitchExprent))
            {
                return(false);
            }
            SwitchExprent sw = (SwitchExprent)o;

            return(InterpreterUtil.EqualObjects(value, sw.GetValue()));
        }
Beispiel #12
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is VarType))
            {
                return(false);
            }
            VarType vt = (VarType)o;

            return(type == vt.type && arrayDim == vt.arrayDim && InterpreterUtil.EqualObjects
                       (value, vt.value));
        }
Beispiel #13
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is FunctionExprent))
            {
                return(false);
            }
            FunctionExprent fe = (FunctionExprent)o;

            return(funcType == fe.GetFuncType() && InterpreterUtil.EqualLists(lstOperands, fe
                                                                              .GetLstOperands()));
        }
Beispiel #14
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is ConstExprent))
            {
                return(false);
            }
            ConstExprent cn = (ConstExprent)o;

            return(InterpreterUtil.EqualObjects(constType, cn.GetConstType()) && InterpreterUtil
                   .EqualObjects(value, cn.GetValue()));
        }
Beispiel #15
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is ExitExprent))
            {
                return(false);
            }
            ExitExprent et = (ExitExprent)o;

            return(exitType == et.GetExitType() && InterpreterUtil.EqualObjects(value, et.GetValue
                                                                                    ()));
        }
Beispiel #16
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is ArrayExprent))
            {
                return(false);
            }
            ArrayExprent arr = (ArrayExprent)o;

            return(InterpreterUtil.EqualObjects(array, arr.GetArray()) && InterpreterUtil.EqualObjects
                       (index, arr.GetIndex()));
        }
Beispiel #17
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is VarExprent))
            {
                return(false);
            }
            VarExprent ve = (VarExprent)o;

            return(index == ve.GetIndex() && version == ve.GetVersion() && InterpreterUtil.EqualObjects
                       (GetVarType(), ve.GetVarType()));
        }
Beispiel #18
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is MonitorExprent))
            {
                return(false);
            }
            MonitorExprent me = (MonitorExprent)o;

            return(monType == me.GetMonType() && InterpreterUtil.EqualObjects(value, me.GetValue
                                                                                  ()));
        }
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is AssignmentExprent))
            {
                return(false);
            }
            AssignmentExprent @as = (AssignmentExprent)o;

            return(InterpreterUtil.EqualObjects(left, @as.GetLeft()) && InterpreterUtil.EqualObjects
                       (right, @as.GetRight()) && condType == @as.GetCondType());
        }
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is AnnotationExprent))
            {
                return(false);
            }
            AnnotationExprent ann = (AnnotationExprent)o;

            return(className.Equals(ann.className) && InterpreterUtil.EqualLists(parNames, ann
                                                                                 .parNames) && InterpreterUtil.EqualLists(parValues, ann.parValues));
        }
Beispiel #21
0
        private static bool IsVersionToBeReplaced(VarVersionPair usedvar, Dictionary <int
                                                                                      , HashSet <VarVersionPair> > mapVars, SSAUConstructorSparseEx ssau, VarVersionPair
                                                  leftpaar)
        {
            VarVersionsGraph    ssuversions = ssau.GetSsuversions();
            SFormsFastMapDirect mapLiveVars = ssau.GetLiveVarVersionsMap(usedvar);

            if (mapLiveVars == null)
            {
                // dummy version, predecessor of a phi node
                return(false);
            }
            // compare protected ranges
            if (!InterpreterUtil.EqualObjects(ssau.GetMapVersionFirstRange().GetOrNullable(leftpaar
                                                                                           ), ssau.GetMapVersionFirstRange().GetOrNullable(usedvar)))
            {
                return(false);
            }
            foreach (KeyValuePair <int, HashSet <VarVersionPair> > ent in mapVars)
            {
                FastSparseSetFactory <int> .FastSparseSet <int> liveverset = mapLiveVars.Get(ent.Key);
                if (liveverset == null)
                {
                    return(false);
                }
                HashSet <VarVersionNode> domset = new HashSet <VarVersionNode>();
                foreach (VarVersionPair verpaar in ent.Value)
                {
                    domset.Add(ssuversions.nodes.GetWithKey(verpaar));
                }
                bool isdom = false;
                foreach (int livever in liveverset)
                {
                    VarVersionNode node = ssuversions.nodes.GetWithKey(new VarVersionPair(ent.Key, livever
                                                                                          ));
                    if (ssuversions.IsDominatorSet(node, domset))
                    {
                        isdom = true;
                        break;
                    }
                }
                if (!isdom)
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #22
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is FieldExprent))
            {
                return(false);
            }
            FieldExprent ft = (FieldExprent)o;

            return(InterpreterUtil.EqualObjects(name, ft.GetName()) && InterpreterUtil.EqualObjects
                       (classname, ft.GetClassname()) && isStatic__ == ft.IsStatic() && InterpreterUtil
                   .EqualObjects(instance, ft.GetInstance()) && InterpreterUtil.EqualObjects(descriptor
                                                                                             , ft.GetDescriptor()));
        }
Beispiel #23
0
        private static void ExtractStaticInitializers(ClassWrapper wrapper, MethodWrapper
                                                      method)
        {
            RootStatement root      = method.root;
            StructClass   cl        = wrapper.GetClassStruct();
            Statement     firstData = Statements.FindFirstData(root);

            if (firstData != null)
            {
                bool inlineInitializers = cl.HasModifier(ICodeConstants.Acc_Interface) || cl.HasModifier
                                              (ICodeConstants.Acc_Enum);
                while (!(firstData.GetExprents().Count == 0))
                {
                    Exprent exprent = firstData.GetExprents()[0];
                    bool    found   = false;
                    if (exprent.type == Exprent.Exprent_Assignment)
                    {
                        AssignmentExprent assignExpr = (AssignmentExprent)exprent;
                        if (assignExpr.GetLeft().type == Exprent.Exprent_Field)
                        {
                            FieldExprent fExpr = (FieldExprent)assignExpr.GetLeft();
                            if (fExpr.IsStatic() && fExpr.GetClassname().Equals(cl.qualifiedName) && cl.HasField
                                    (fExpr.GetName(), fExpr.GetDescriptor().descriptorString))
                            {
                                // interfaces fields should always be initialized inline
                                if (inlineInitializers || IsExprentIndependent(assignExpr.GetRight(), method))
                                {
                                    string keyField = InterpreterUtil.MakeUniqueKey(fExpr.GetName(), fExpr.GetDescriptor
                                                                                        ().descriptorString);
                                    if (!wrapper.GetStaticFieldInitializers().ContainsKey(keyField))
                                    {
                                        wrapper.GetStaticFieldInitializers().AddWithKey(assignExpr.GetRight(), keyField);
                                        firstData.GetExprents().RemoveAtReturningValue(0);
                                        found = true;
                                    }
                                }
                            }
                        }
                    }
                    if (!found)
                    {
                        break;
                    }
                }
            }
        }
Beispiel #24
0
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is NewExprent))
            {
                return(false);
            }
            NewExprent ne = (NewExprent)o;

            return(InterpreterUtil.EqualObjects(newType, ne.GetNewType()) && InterpreterUtil.
                   EqualLists(lstDims, ne.GetLstDims()) && InterpreterUtil.EqualObjects(constructor
                                                                                        , ne.GetConstructor()) && directArrayInit == ne.directArrayInit && InterpreterUtil
                   .EqualLists(lstArrayElements, ne.GetLstArrayElements()));
        }
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is InvocationExprent))
            {
                return(false);
            }
            InvocationExprent it = (InvocationExprent)o;

            return(InterpreterUtil.EqualObjects(name, it.GetName()) && InterpreterUtil.EqualObjects
                       (classname, it.GetClassname()) && isStatic__ == it.IsStatic() && InterpreterUtil
                   .EqualObjects(instance, it.GetInstance()) && InterpreterUtil.EqualObjects(descriptor
                                                                                             , it.GetDescriptor()) && functype == it.GetFunctype() && InterpreterUtil.EqualLists
                       (lstParameters, it.GetLstParameters()));
        }
Beispiel #26
0
 /// <exception cref="System.IO.IOException"/>
 private void AddArchive(string path, FileSystemInfo file, int type, bool isOwn)
 {
     using (ZipArchive archive = ZipFile.Open((file.FullName), ZipArchiveMode.Read))
     {
         foreach (ZipArchiveEntry entry in archive.Entries)
         {
             ContextUnit unit = units.GetOrNull(path + "/" + file.Name);
             if (unit == null)
             {
                 unit = new ContextUnit(type, path, file.Name, isOwn, saver, decompiledData);
                 if (type == ContextUnit.Type_Jar)
                 {
                     //TODO: Set file manifest
                     // unit.SetManifest((archive).GetManifest());
                 }
                 Sharpen.Collections.Put(units, path + "/" + file.Name, unit);
             }
             string name = entry.FullName;
             if (!(entry.FullName.EndsWith('/') || entry.FullName.EndsWith('\\')))                     //IsDirectory
             {
                 if (name.EndsWith(".class"))
                 {
                     byte[]      bytes = InterpreterUtil.GetBytes(archive, entry);
                     StructClass cl    = new StructClass(bytes, isOwn, loader);
                     Sharpen.Collections.Put(classes, cl.qualifiedName, cl);
                     unit.AddClass(cl, name);
                     loader.AddClassLink(cl.qualifiedName, new LazyLoader.Link(file.FullName,
                                                                               name));
                 }
                 else
                 {
                     unit.AddOtherEntry(file.FullName, name);
                 }
             }
             else
             {
                 unit.AddDirEntry(Path.GetDirectoryName(entry.FullName));
             }
         }
     }
 }
        // *******************************************************************
        // Interface IBytecodeProvider
        // *******************************************************************
        /// <exception cref="IOException"/>
        public virtual byte[] GetBytecode(string externalPath, string internalPath)
        {
            var file = new FileInfo(externalPath);

            if (internalPath == null)
            {
                return(InterpreterUtil.GetBytes(file));
            }
            else
            {
                using (var archive = ZipFile.Open(file.FullName, ZipArchiveMode.Read))
                {
                    var entry = archive.GetEntry(internalPath);
                    if (entry == null)
                    {
                        throw new IOException("Entry not found: " + internalPath);
                    }
                    return(InterpreterUtil.GetBytes(archive, entry));
                }
            }
        }
        private bool IsVarArgCall()
        {
            StructClass cl = DecompilerContext.GetStructContext().GetClass(classname);

            if (cl != null)
            {
                StructMethod mt = cl.GetMethod(InterpreterUtil.MakeUniqueKey(name, stringDescriptor
                                                                             ));
                if (mt != null)
                {
                    return(mt.HasModifier(ICodeConstants.Acc_Varargs));
                }
            }
            else
            {
                // TODO: tap into IDEA indices to access libraries methods details
                // try to check the class on the classpath
                MethodInfo mtd = ClasspathHelper.FindMethod(classname, name, descriptor);
                return(mtd != null && mtd.GetParameters()
                       .Any(param => Attribute.IsDefined(param, typeof(ParamArrayAttribute))));
            }
            return(false);
        }
Beispiel #29
0
 private static bool MapsEqual(SFormsFastMapDirect map1, SFormsFastMapDirect map2)
 {
     if (map1 == null)
     {
         return(map2 == null);
     }
     else if (map2 == null)
     {
         return(false);
     }
     if (map1.Size() != map2.Size())
     {
         return(false);
     }
     foreach (KeyValuePair <int, FastSparseSetFactory <int> .FastSparseSet <int> > ent2 in map2.
              EntryList())
     {
         if (!InterpreterUtil.EqualObjects(map1.Get(ent2.Key), ent2.Value))
         {
             return(false);
         }
     }
     return(true);
 }
        public static void ProcessClassReferences(ClassesProcessor.ClassNode node)
        {
            // find the synthetic method Class class$(String) if present
            Dictionary <ClassWrapper, MethodWrapper> mapClassMeths = new Dictionary <ClassWrapper
                                                                                     , MethodWrapper>();

            MapClassMethods(node, mapClassMeths);
            if ((mapClassMeths.Count == 0))
            {
                return;
            }
            HashSet <ClassWrapper> setFound = new HashSet <ClassWrapper>();

            ProcessClassRec(node, mapClassMeths, setFound);
            if (!(setFound.Count == 0))
            {
                foreach (ClassWrapper wrp in setFound)
                {
                    StructMethod mt = mapClassMeths.GetOrNull(wrp).methodStruct;
                    wrp.GetHiddenMembers().Add(InterpreterUtil.MakeUniqueKey(mt.GetName(), mt.GetDescriptor
                                                                                 ()));
                }
            }
        }