コード例 #1
0
        public static string MethodReplacementObjectiveNameTemplate(string className, int line, int index)
        {
            var name = METHOD_REPLACEMENT + "_at_" + ClassName.Get(className).GetFullNameWithDots() +
                       "_" + PadNumber(line) + "_" + index;

            return(name); //.intern();
        }
コード例 #2
0
                                            IDictionary <int, IDictionary <int, IDictionary <bool, string> > > >(); //TODO: capacity 10_000

        public static string BranchObjectiveName(string className, int line, int branchId, bool thenBranch)
        {
            var m0 =
                BranchCache.ComputeIfAbsent(className,
                                            k => new ConcurrentDictionary <int,
                                                                           IDictionary <int, IDictionary <bool, string> > >()); //TODO: capacity 10_000
            var m1 = m0.ComputeIfAbsent(line,
                                        k => new ConcurrentDictionary <int, IDictionary <bool, string> >());                    //TODO: capacity 10
            var
                m2 = m1.ComputeIfAbsent(branchId, k => new ConcurrentDictionary <bool, string>());                              //TODO: capacity 2

            return(m2.ComputeIfAbsent(thenBranch, k => {
                var name = BRANCH + "_at_" +
                           ClassName.Get(className).GetFullNameWithDots()
                           + "_at_line_" + PadNumber(line) + "_position_" + branchId;
                if (thenBranch)
                {
                    name += TRUE_BRANCH;
                }
                else
                {
                    name += FALSE_BRANCH;
                }

                return name;
            }));
        }
コード例 #3
0
        public static string LineObjectiveName(string className, int line)
        {
            var map =
                LineCache.ComputeIfAbsent(className,
                                          c => new ConcurrentDictionary <int, string>()); //TODO: capacity 1000

            return(map.ComputeIfAbsent(line,
                                       l => LINE + "_at_" + ClassName.Get(className).GetFullNameWithDots() + "_" + PadNumber(line)));

//        string name = LINE + "_at_" + ClassName.get(className).getFullNameWithDots() + "_" + padNumber(line);
//        return name;//.intern();
        }
コード例 #4
0
        public static string SuccessCallObjectiveName(string className, int line, int index)
        {
            var m0 =
                CacheSuccessCall.ComputeIfAbsent(className,
                                                 c => new ConcurrentDictionary <int, IDictionary <int, string> >()); //TODO: capacity 10_000
            var
                m1 = m0.ComputeIfAbsent(line, l => new ConcurrentDictionary <int, string>());                        //TODO: capacity 10

            return(m1.ComputeIfAbsent(index, i =>
                                      SUCCESS_CALL + "_at_" + ClassName.Get(className).GetFullNameWithDots() +
                                      "_" + PadNumber(line) + "_" + index));
        }
コード例 #5
0
 public static string ClassObjectiveName(string className)
 {
     return(CacheClass.ComputeIfAbsent(className, c => CLASS + "_" + ClassName.Get(c).GetFullNameWithDots()));
     //string name = CLASS + "_" + ClassName.get(className).getFullNameWithDots();
     //return name;//.intern();
 }