Fix toJsonClassLoaderContextRec size bug
toJsonClassLoaderContextRec's size is twice as large than expected. And the initial values is filled with null value. Bug: 158843648 Test: m nothing(testcase is added) Change-Id: I24c23269bd16baa18481f34b85c543d41f26d0e0
This commit is contained in:
@@ -544,13 +544,13 @@ func toJsonClassLoaderContext(clcMap ClassLoaderContextMap) jsonClassLoaderConte
|
||||
// Recursive helper for toJsonClassLoaderContext.
|
||||
func toJsonClassLoaderContextRec(clcs []*ClassLoaderContext) []*jsonClassLoaderContext {
|
||||
jClcs := make([]*jsonClassLoaderContext, len(clcs))
|
||||
for _, clc := range clcs {
|
||||
jClcs = append(jClcs, &jsonClassLoaderContext{
|
||||
for i, clc := range clcs {
|
||||
jClcs[i] = &jsonClassLoaderContext{
|
||||
Name: clc.Name,
|
||||
Host: clc.Host.String(),
|
||||
Device: clc.Device,
|
||||
Subcontexts: toJsonClassLoaderContextRec(clc.Subcontexts),
|
||||
})
|
||||
}
|
||||
}
|
||||
return jClcs
|
||||
}
|
||||
|
Reference in New Issue
Block a user