Explorar o código

Port to Semantic UAST

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
Vadim Markovtsev %!s(int64=6) %!d(string=hai) anos
pai
achega
a4fcc2bdf8

+ 87 - 96
internal/pb/pb.pb.go

@@ -437,11 +437,10 @@ func (m *UASTChangesSaverResults) GetChanges() []*UASTChange {
 }
 
 type ShotnessRecord struct {
-	InternalRole string          `protobuf:"bytes,1,opt,name=internal_role,json=internalRole,proto3" json:"internal_role,omitempty"`
-	Roles        []int32         `protobuf:"varint,2,rep,packed,name=roles" json:"roles,omitempty"`
-	Name         string          `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
-	File         string          `protobuf:"bytes,4,opt,name=file,proto3" json:"file,omitempty"`
-	Counters     map[int32]int32 `protobuf:"bytes,5,rep,name=counters" json:"counters,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
+	Type     string          `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
+	Name     string          `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
+	File     string          `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"`
+	Counters map[int32]int32 `protobuf:"bytes,4,rep,name=counters" json:"counters,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
 }
 
 func (m *ShotnessRecord) Reset()                    { *m = ShotnessRecord{} }
@@ -449,20 +448,13 @@ func (m *ShotnessRecord) String() string            { return proto.CompactTextSt
 func (*ShotnessRecord) ProtoMessage()               {}
 func (*ShotnessRecord) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{10} }
 
-func (m *ShotnessRecord) GetInternalRole() string {
+func (m *ShotnessRecord) GetType() string {
 	if m != nil {
-		return m.InternalRole
+		return m.Type
 	}
 	return ""
 }
 
-func (m *ShotnessRecord) GetRoles() []int32 {
-	if m != nil {
-		return m.Roles
-	}
-	return nil
-}
-
 func (m *ShotnessRecord) GetName() string {
 	if m != nil {
 		return m.Name
@@ -736,86 +728,85 @@ func init() {
 func init() { proto.RegisterFile("pb.proto", fileDescriptorPb) }
 
 var fileDescriptorPb = []byte{
-	// 1294 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0xdf, 0x72, 0xdb, 0xc4,
-	0x17, 0x1e, 0x59, 0xfe, 0x7b, 0x64, 0x27, 0xed, 0xb6, 0xbf, 0xc6, 0xf5, 0x6f, 0x52, 0x8c, 0x28,
-	0x25, 0xd0, 0xa2, 0x32, 0x2e, 0x17, 0x50, 0x6e, 0x9a, 0x26, 0x74, 0x9a, 0x99, 0x06, 0x98, 0x75,
-	0x03, 0x97, 0x9a, 0x8d, 0xb5, 0x49, 0x04, 0xd6, 0xca, 0xb3, 0x2b, 0x39, 0xf1, 0xcb, 0x70, 0xc7,
-	0x0c, 0x30, 0xc3, 0x70, 0xc1, 0x0b, 0x70, 0xc1, 0xb3, 0x70, 0xc3, 0x4b, 0x30, 0xfb, 0x4f, 0x96,
-	0x8c, 0x52, 0xb8, 0xd3, 0x39, 0xe7, 0x3b, 0xbb, 0xdf, 0x7e, 0xe7, 0xec, 0x91, 0x04, 0xdd, 0xc5,
-	0x69, 0xb0, 0xe0, 0x69, 0x96, 0xfa, 0x7f, 0x36, 0xa0, 0x7b, 0x4c, 0x33, 0x12, 0x91, 0x8c, 0xa0,
-	0x21, 0x74, 0x96, 0x94, 0x8b, 0x38, 0x65, 0x43, 0x67, 0xec, 0xec, 0xb5, 0xb0, 0x35, 0x11, 0x82,
-	0xe6, 0x05, 0x11, 0x17, 0xc3, 0xc6, 0xd8, 0xd9, 0xeb, 0x61, 0xf5, 0x8c, 0xee, 0x01, 0x70, 0xba,
-	0x48, 0x45, 0x9c, 0xa5, 0x7c, 0x35, 0x74, 0x55, 0xa4, 0xe4, 0x41, 0x0f, 0x60, 0xfb, 0x94, 0x9e,
-	0xc7, 0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 0x6c, 0x02, 0xe8, 0xa9,
-	0xd4, 0x8b, 0x65, 0x85, 0x5e, 0xb2, 0xd4, 0x9b, 0x65, 0x3e, 0x30, 0x80, 0x62, 0x34, 0x6a, 0x53,
-	0x8f, 0xc6, 0x52, 0xe8, 0xdf, 0x3e, 0x71, 0xfb, 0x25, 0xbe, 0xa7, 0x6d, 0xf5, 0x4b, 0xf1, 0xe4,
-	0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0x05, 0x6a, 0xf9, 0x5e, 0x0c, 0x00, 0x00,
+	// 1272 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x5d, 0x6f, 0x1b, 0x45,
+	0x17, 0xd6, 0xfa, 0xdb, 0x67, 0xf3, 0xd1, 0x4e, 0xfb, 0x36, 0xae, 0x5f, 0xa5, 0x98, 0x55, 0x29,
+	0x81, 0x96, 0x2d, 0x72, 0xb9, 0x80, 0x72, 0xd3, 0x34, 0xa1, 0x6a, 0xa4, 0x06, 0xd0, 0xb8, 0x85,
+	0x4b, 0x6b, 0xe2, 0x9d, 0xc4, 0x0b, 0xde, 0xd9, 0xd5, 0xcc, 0xac, 0x93, 0xfd, 0x33, 0xdc, 0x21,
+	0x01, 0x12, 0xe2, 0x82, 0x3f, 0xc0, 0x05, 0xbf, 0x85, 0xdf, 0x81, 0xe6, 0x6b, 0xbd, 0x36, 0x9b,
+	0xc2, 0xdd, 0x9e, 0x73, 0x9e, 0x33, 0xf3, 0xcc, 0x73, 0xce, 0x9c, 0xb1, 0xa1, 0x97, 0x9d, 0x85,
+	0x19, 0x4f, 0x65, 0x1a, 0xfc, 0xd5, 0x80, 0xde, 0x29, 0x95, 0x24, 0x22, 0x92, 0xa0, 0x01, 0x74,
+	0x97, 0x94, 0x8b, 0x38, 0x65, 0x03, 0x6f, 0xe4, 0x1d, 0xb4, 0xb1, 0x33, 0x11, 0x82, 0xd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xf3, 0xab, 0x07, 0xbb, 0x9b, 0x35, 0x7c, 0x17, 0x3a, 0x73, 0x4a, 0x22, 0xca, 0xf5,
+	0x72, 0xfe, 0xb8, 0x5f, 0xfe, 0x42, 0xc5, 0x36, 0x80, 0x9e, 0x2a, 0xbd, 0x98, 0x2c, 0xf5, 0x52,
+	0xa5, 0xde, 0x2c, 0xf3, 0x91, 0x05, 0x94, 0xa3, 0xd1, 0x98, 0x66, 0x34, 0x56, 0x42, 0xff, 0xf6,
+	0xdb, 0x75, 0xab, 0xc2, 0xf7, 0xac, 0xa3, 0xff, 0x2b, 0x3c, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff,
+	0x7c, 0xd1, 0x8f, 0x8d, 0x37, 0x0c, 0x00, 0x00,
 }

+ 4 - 5
internal/pb/pb.proto

@@ -88,11 +88,10 @@ message UASTChangesSaverResults {
 }
 
 message ShotnessRecord {
-    string internal_role = 1;
-    repeated int32 roles = 2;
-    string name = 3;
-    string file = 4;
-    map<int32, int32> counters = 5;
+    string type = 1;
+    string name = 2;
+    string file = 3;
+    map<int32, int32> counters = 4;
 }
 
 message ShotnessAnalysisResults {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 43 - 50
internal/pb/pb_pb2.py


+ 12 - 2
internal/plumbing/uast/changes_xpather.go

@@ -4,10 +4,10 @@ import (
 	"bytes"
 	"io"
 	"log"
+	"sort"
 
 	"github.com/minio/highwayhash"
 	"gopkg.in/bblfsh/client-go.v3/tools"
-	bblfsh "gopkg.in/bblfsh/sdk.v2/uast"
 	"gopkg.in/bblfsh/sdk.v2/uast/nodes"
 	"gopkg.in/src-d/go-git.v4/plumbing"
 )
@@ -73,6 +73,16 @@ func (xpather ChangesXPather) hash(nodesToHash []nodes.Node) map[uint64]nodes.No
 
 func stringifyUASTNode(node nodes.Node, writer io.Writer) {
 	for element := range tools.Iterate(tools.NewIterator(node, tools.PositionOrder)) {
-		writer.Write([]byte(bblfsh.TokenOf(element.(nodes.Object)) + "|" + bblfsh.TypeOf(element) + ">"))
+		var keys []string
+		obj := element.(nodes.Object)
+		for key, val := range obj {
+			if _, ok := val.(nodes.String); ok {
+				keys = append(keys, key)
+			}
+		}
+		sort.Strings(keys)
+		for _, key := range keys {
+			writer.Write([]byte(key + "=" + string(obj[key].(nodes.String)) + ";"))
+		}
 	}
 }

+ 1 - 1
internal/plumbing/uast/test/utils.go

@@ -24,7 +24,7 @@ func ParseBlobFromTestRepo(hash, name string, client *bblfsh.Client) nodes.Node
 	if err != nil {
 		panic(err)
 	}
-	request := client.NewParseRequest().Content(string(data)).Filename(name).Mode(bblfsh.Annotated)
+	request := client.NewParseRequest().Content(string(data)).Filename(name).Mode(bblfsh.Semantic)
 	response, _, err := request.UAST()
 	if err != nil {
 		panic(err)

+ 1 - 1
internal/plumbing/uast/uast.go

@@ -267,7 +267,7 @@ func (exr *Extractor) extractUAST(
 		defer cancel()
 	}
 	request := client.NewParseRequest().
-		Content(string(data)).Filename(name).Mode(bblfsh.Annotated).Context(ctx)
+		Content(string(data)).Filename(name).Mode(bblfsh.Semantic).Context(ctx)
 	response, _, err := request.UAST()
 	if err != nil {
 		if strings.Contains("missing driver", err.Error()) {

BIN=BIN
internal/test_data/uast1.pb


BIN=BIN
internal/test_data/uast2.pb


+ 2 - 6
leaves/comment_sentiment.go

@@ -150,7 +150,7 @@ func (sent *CommentSentimentAnalysis) validate() {
 // calls. The repository which is going to be analysed is supplied as an argument.
 func (sent *CommentSentimentAnalysis) Initialize(repository *git.Repository) error {
 	sent.commentsByDay = map[int][]string{}
-	sent.xpather = &uast_items.ChangesXPather{XPath: "//*[@role='Comment']"}
+	sent.xpather = &uast_items.ChangesXPather{XPath: "//uast:Comment"}
 	sent.validate()
 	sent.OneShotMergeProcessor.Initialize()
 	return nil
@@ -324,11 +324,7 @@ func (sent *CommentSentimentAnalysis) mergeComments(extracted []nodes.Node) []st
 			if pos.End() != nil && maxEnd < int(pos.End().Line) {
 				maxEnd = int(pos.End().Line)
 			}
-			token := strings.TrimSpace(uast.TokenOf(node.(nodes.Object)))
-			// FIXME(vmarkovtsev): remove this hack when https://github.com/bblfsh/go-driver/issues/39 is fixed
-			if len(token) > 0 && token[0] == '#' {
-				token = token[1:]
-			}
+			token := strings.TrimSpace(string(node.(nodes.Object)["Text"].(nodes.String)))
 			if token != "" {
 				buffer = append(buffer, token)
 			}

+ 4 - 4
leaves/comment_sentiment_test.go

@@ -156,12 +156,12 @@ func TestCommentSentimentConsume(t *testing.T) {
 	hash2 := "2a7392320b332494a08d5113aabe6d056fef7e9d"
 	root1 := uast_test.ParseBlobFromTestRepo(hash1, "labours.py", client)
 	root2 := uast_test.ParseBlobFromTestRepo(hash2, "labours.py", client)
-	comments, _ := tools.Filter(root2, "//*[@role='Comment']")
+	comments, _ := tools.Filter(root2, "//uast:Comment")
 	for _, c := range query.AllNodes(comments) {
 		obj := c.(nodes.Object)
-		t := strings.TrimSpace(uast.TokenOf(obj))
+		t := strings.TrimSpace(string(obj["Text"].(nodes.String)))
 		if t == "we need to adjust the peak, it may not be less than the decayed value" {
-			obj[uast.KeyToken] = nodes.String("license copyright boring")
+			obj["Text"] = nodes.String("license copyright boring")
 		} else if t == "Tensorflow 1.5 parses sys.argv unconditionally *applause*" {
 			obj[uast.KeyPos].(nodes.Object)[uast.KeyStart] = nil
 		}
@@ -179,7 +179,7 @@ func TestCommentSentimentConsume(t *testing.T) {
 	assert.Nil(t, err)
 	assert.Nil(t, result)
 	assert.Len(t, sent.commentsByDay, 1)
-	assert.Len(t, sent.commentsByDay[0], 6)
+	assert.Len(t, sent.commentsByDay[0], 4)
 }
 
 var (

+ 17 - 35
leaves/shotness.go

@@ -13,7 +13,6 @@ import (
 	"gopkg.in/bblfsh/sdk.v2/uast"
 	uast_nodes "gopkg.in/bblfsh/sdk.v2/uast/nodes"
 	"gopkg.in/bblfsh/sdk.v2/uast/query"
-	"gopkg.in/bblfsh/sdk.v2/uast/role"
 	"gopkg.in/src-d/go-git.v4"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/hercules.v7/internal/core"
@@ -45,10 +44,10 @@ const (
 
 	// DefaultShotnessXpathStruct is the default UAST XPath to choose the analysed nodes.
 	// It extracts functions.
-	DefaultShotnessXpathStruct = "//*[@role='Function' and @role='Declaration']"
+	DefaultShotnessXpathStruct = "//uast:FunctionGroup"
 	// DefaultShotnessXpathName is the default UAST XPath to choose the names of the analysed nodes.
 	// It looks at the current tree level and at the immediate children.
-	DefaultShotnessXpathName = "/*[1]/*/*[@role='Function' and @role='Identifier' and @role='Name'] | /*[1]"
+	DefaultShotnessXpathName = "//uast:Function/../../Name | /name"
 )
 
 type nodeShotness struct {
@@ -60,10 +59,9 @@ type nodeShotness struct {
 // NodeSummary carries the node attributes which annotate the "shotness" analysis' counters.
 // These attributes are supposed to uniquely identify each node.
 type NodeSummary struct {
-	InternalRole string
-	Roles        []role.Role
-	Name         string
-	File         string
+	Type string
+	Name string
+	File string
 }
 
 // ShotnessResult is returned by ShotnessAnalysis.Finalize() and represents the analysis result.
@@ -73,7 +71,7 @@ type ShotnessResult struct {
 }
 
 func (node NodeSummary) String() string {
-	return node.InternalRole + "_" + node.Name + "_" + node.File
+	return node.Type + "_" + node.Name + "_" + node.File
 }
 
 // Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
@@ -172,10 +170,9 @@ func (shotness *ShotnessAnalysis) Consume(deps map[string]interface{}) (map[stri
 
 	addNode := func(name string, node uast_nodes.Node, fileName string) {
 		nodeSummary := NodeSummary{
-			InternalRole: uast.TypeOf(node),
-			Roles:        uast.RolesOf(node.(uast_nodes.Object)),
-			Name:         name,
-			File:         fileName,
+			Type: uast.TypeOf(node),
+			Name: name,
+			File: fileName,
 		}
 		key := nodeSummary.String()
 		exists := allNodes[key]
@@ -391,15 +388,8 @@ func (shotness *ShotnessAnalysis) Serialize(result interface{}, binary bool, wri
 
 func (shotness *ShotnessAnalysis) serializeText(result *ShotnessResult, writer io.Writer) {
 	for i, summary := range result.Nodes {
-		fmt.Fprintf(writer, "  - name: %s\n    file: %s\n    internal_role: %s\n    roles: [",
-			summary.Name, summary.File, summary.InternalRole)
-		for j, r := range summary.Roles {
-			if j < len(summary.Roles)-1 {
-				fmt.Fprintf(writer, "%d,", r)
-			} else {
-				fmt.Fprintf(writer, "%d]\n    counters: {", r)
-			}
-		}
+		fmt.Fprintf(writer, "  - name: %s\n    file: %s\n    internal_role: %s\n    counters: {",
+			summary.Name, summary.File, summary.Type)
 		keys := make([]int, len(result.Counters[i]))
 		j := 0
 		for key := range result.Counters[i] {
@@ -426,14 +416,10 @@ func (shotness *ShotnessAnalysis) serializeBinary(result *ShotnessResult, writer
 	}
 	for i, summary := range result.Nodes {
 		record := &pb.ShotnessRecord{
-			Name:         summary.Name,
-			File:         summary.File,
-			InternalRole: summary.InternalRole,
-			Roles:        make([]int32, len(summary.Roles)),
-			Counters:     map[int32]int32{},
-		}
-		for j, r := range summary.Roles {
-			record.Roles[j] = int32(r)
+			Name:     summary.Name,
+			File:     summary.File,
+			Type:     summary.Type,
+			Counters: map[int32]int32{},
 		}
 		for key, val := range result.Counters[i] {
 			record.Counters[int32(key)] = int32(val)
@@ -479,15 +465,11 @@ func (shotness *ShotnessAnalysis) extractNodes(root uast_nodes.Node) (map[string
 		if internal[uast_nodes.UniqueKey(node)] {
 			continue
 		}
-		it, err := tools.Filter(node, shotness.XpathName)
+		nodeName, err := tools.FilterNode(node, shotness.XpathName)
 		if err != nil {
 			return nil, err
 		}
-		nodeNames := query.AllNodes(it)
-		if len(nodeNames) == 0 {
-			continue
-		}
-		res[uast.TokenOf(nodeNames[0].(uast_nodes.Object))] = node
+		res[string(nodeName.(uast_nodes.Object)["Name"].(uast_nodes.String))] = node
 	}
 	return res, nil
 }

+ 21 - 39
leaves/shotness_test.go

@@ -182,7 +182,7 @@ func TestShotnessConsume(t *testing.T) {
 	assert.Len(t, sh.files, 1)
 	assert.Len(t, sh.files["new.java"], 18)
 	for _, node := range sh.nodes {
-		assert.Equal(t, node.Summary.InternalRole, "MethodDeclaration")
+		assert.Equal(t, node.Summary.Type, "uast:FunctionGroup")
 		if node.Summary.Name != "testUnpackEntryFromFile" {
 			assert.Equal(t, node.Count, 1)
 			if node.Summary.Name != "testUnpackEntryFromStreamToFile" {
@@ -202,10 +202,10 @@ func TestShotnessConsume(t *testing.T) {
 		t.FailNow()
 	}
 	assert.Equal(t, result.Nodes[14].String(),
-		"MethodDeclaration_testUnpackEntryFromStreamToFile_"+newfileName)
+		"uast:FunctionGroup_testUnpackEntryFromStreamToFile_"+newfileName)
 	assert.Equal(t, result.Counters[14], map[int]int{14: 1, 13: 1})
 	assert.Equal(t, result.Nodes[15].String(),
-		"MethodDeclaration_testUnpackEntryFromStream_"+newfileName)
+		"uast:FunctionGroup_testUnpackEntryFromStream_"+newfileName)
 	assert.Equal(t, result.Counters[15], map[int]int{
 		8: 1, 0: 1, 5: 1, 6: 1, 11: 1, 1: 1, 13: 1, 17: 1, 3: 1, 15: 1, 9: 1, 4: 1, 7: 1, 16: 1, 2: 1, 12: 1, 10: 1})
 	uastChanges[0] = uast_items.Change{
@@ -242,93 +242,75 @@ func TestShotnessSerializeText(t *testing.T) {
 	sh.Serialize(result, false, buffer)
 	assert.Equal(t, buffer.String(), `  - name: testAddEntry
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testArchiveEquals
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testContainsAnyEntry
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testDuplicateEntryAtAddOrReplace
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testDuplicateEntryAtAdd
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testDuplicateEntryAtReplace
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testPackEntries
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testPackEntry
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testPreserveRoot
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testRemoveDirs
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testRemoveEntry
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testRepackArchive
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testUnexplode
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testUnpackEntryFromFile
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":2,"14":1,"15":1,"16":1,"17":1}
   - name: testUnpackEntryFromStreamToFile
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"13":1,"14":1}
   - name: testUnpackEntryFromStream
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: testZipException
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,59,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
   - name: unexplodeWithException
     file: test.java
-    internal_role: MethodDeclaration
-    roles: [111,100,41,45]
+    internal_role: uast:FunctionGroup
     counters: {"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"17":1}
 `)
 }