MCPcopy Create free account
hub / github.com/golang/mobile / fillAllMethods

Method fillAllMethods

internal/importers/java/java.go:1065–1103  ·  view source on GitHub ↗
(cls *Class)

Source from the content-addressed store, hash-verified

1063}
1064
1065func (j *Importer) fillAllMethods(cls *Class) {
1066 if len(cls.AllMethods) > 0 {
1067 return
1068 }
1069 for _, supName := range cls.Supers {
1070 super := j.clsMap[supName]
1071 j.fillAllMethods(super)
1072 }
1073 var fsets []*FuncSet
1074 fsets = append(fsets, cls.Methods...)
1075 for _, supName := range cls.Supers {
1076 super := j.clsMap[supName]
1077 fsets = append(fsets, super.AllMethods...)
1078 }
1079 sigs := make(map[FuncSig]struct{})
1080 methods := make(map[string]*FuncSet)
1081 for _, fs := range fsets {
1082 clsFs, exists := methods[fs.Name]
1083 if !exists {
1084 clsFs = &FuncSet{
1085 Name: fs.Name,
1086 GoName: fs.GoName,
1087 CommonSig: fs.CommonSig,
1088 }
1089 cls.AllMethods = append(cls.AllMethods, clsFs)
1090 methods[fs.Name] = clsFs
1091 } else {
1092 // Combine the (overloaded) signature with the other variants.
1093 clsFs.CommonSig = combineSigs(j.clsMap, clsFs.CommonSig, fs.CommonSig)
1094 }
1095 for _, f := range fs.Funcs {
1096 if _, exists := sigs[f.FuncSig]; exists {
1097 continue
1098 }
1099 sigs[f.FuncSig] = struct{}{}
1100 clsFs.Funcs = append(clsFs.Funcs, f)
1101 }
1102 }
1103}
1104
1105func (j *Importer) parseJavaValue(v string) (string, bool) {
1106 v = strings.TrimRight(v, "ldf")

Callers 1

ImportMethod · 0.95

Calls 1

combineSigsFunction · 0.85

Tested by

no test coverage detected