You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/02/08 12:53:45 UTC

[GitHub] [beam] KhaninArtur commented on a change in pull request #16683: [BEAM-13713][Playground] Java graph extraction

KhaninArtur commented on a change in pull request #16683:
URL: https://github.com/apache/beam/pull/16683#discussion_r801576485



##########
File path: playground/backend/internal/preparers/java_preparers.go
##########
@@ -103,10 +138,38 @@ func GetJavaPreparers(builder *PreparersBuilder, isUnitTest bool, isKata bool) {
 	if isKata {
 		builder.JavaPreparers().
 			WithPublicClassRemover().
-			WithPackageRemover()
+			WithPackageRemover().
+			WithGraphHandler()
 	}
 }
 
+// findPipelineObjectName finds name of pipeline in JAVA code when pipeline creates
+func findPipelineObjectName(filepath string) (string, error) {
+	reg := regexp.MustCompile(pipelineNamePattern)
+	b, err := ioutil.ReadFile(filepath)
+	if err != nil {
+		return "", err
+	}
+	matches := reg.FindStringSubmatch(string(b))
+	if len(matches) > 0 {
+		return matches[1], nil
+	} else {
+		return "", nil
+	}
+
+}
+
+func findImports(filepath string) ([]string, error) {
+	reg := regexp.MustCompile(findImportsPattern)
+	b, err := ioutil.ReadFile(filepath)
+	if err != nil {
+		return nil, err
+	}
+	imports := reg.FindAllString(string(b), -1)
+
+	return imports, nil
+}

Review comment:
       Please, delete this function and tests for it as we discussed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org