From 2cdb877ab894f6f04e3ecb4fb37a8d3018bac601 Mon Sep 17 00:00:00 2001 From: Pranav Gaikwad Date: Wed, 3 Jul 2024 10:53:28 -0400 Subject: [PATCH] Revert ":bug: Be able to process FIELD rules (#628)" This reverts commit 8a0c9ff7a3437041a7241ffa0ad5d176febf9003. --- demo-output.yaml | 13 ------------- .../pkg/java_external_provider/provider.go | 1 - .../pkg/java_external_provider/service_client.go | 2 -- rule-example.yaml | 10 +--------- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/demo-output.yaml b/demo-output.yaml index fd1953b9..1a8090dc 100644 --- a/demo-output.yaml +++ b/demo-output.yaml @@ -899,19 +899,6 @@ matchingXML: "" effort: 1 insights: - field-rule-00001: - description: Sample field declaration rule - category: mandatory - incidents: - - uri: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java - message: Field found - codeSnip: " 8 import org.springframework.data.domain.Page;\n 9 import org.springframework.data.domain.Pageable;\n10 import org.springframework.stereotype.Service;\n11 import org.springframework.transaction.annotation.Transactional;\n12 \n13 @Service\n14 @Transactional\n15 public class CustomerService implements ICustomerService{\n16 \t\n17 \t@Autowired\n18 \tprivate CustomerRepository repository;\n19 \t\n20 \tprivate static Logger logger = Logger.getLogger( CustomerService.class.getName() );\n21 \t\n22 \tpublic Customer findById(Long id) {\n23 \t\tlogger.debug(\"Entering CustomerService.findById()\");\n24 \t\tCustomer c = repository.findById(id).orElse(null);\n25 \t\tlogger.debug(\"Returning element: \" + c);\n26 \t\treturn c;\n27 \t}\n28 \t" - lineNumber: 18 - variables: - file: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/service/CustomerService.java - kind: Field - name: repository - package: io.konveyor.demo.ordermanagement.service java-downloaded-maven-artifact: description: | This rule tests the application downloaded from maven artifact diff --git a/external-providers/java-external-provider/pkg/java_external_provider/provider.go b/external-providers/java-external-provider/pkg/java_external_provider/provider.go index 93ba3529..e329a63a 100644 --- a/external-providers/java-external-provider/pkg/java_external_provider/provider.go +++ b/external-providers/java-external-provider/pkg/java_external_provider/provider.go @@ -58,7 +58,6 @@ var locationToCode = map[string]int{ "variable_declaration": 9, "type": 10, "package": 11, - "field": 12, } type javaProvider struct { diff --git a/external-providers/java-external-provider/pkg/java_external_provider/service_client.go b/external-providers/java-external-provider/pkg/java_external_provider/service_client.go index f59ed947..ccb83704 100644 --- a/external-providers/java-external-provider/pkg/java_external_provider/service_client.go +++ b/external-providers/java-external-provider/pkg/java_external_provider/service_client.go @@ -80,8 +80,6 @@ func (p *javaServiceClient) Evaluate(ctx context.Context, cap string, conditionI incidents, err = p.filterDefault(symbols) case 11: incidents, err = p.filterDefault(symbols) - case 12: - incidents, err = p.filterDefault(symbols) default: } diff --git a/rule-example.yaml b/rule-example.yaml index 542f0234..67bfb04c 100644 --- a/rule-example.yaml +++ b/rule-example.yaml @@ -329,12 +329,4 @@ ruleID: java-downloaded-maven-artifact when: java.referenced: - pattern: io.javaoperatorsdk.operator.Operator -- category: mandatory - description: Sample field declaration rule - message: "Field found" - ruleID: field-rule-00001 - when: - java.referenced: - pattern: io.konveyor.demo.ordermanagement.repository.CustomerRepository - location: FIELD + pattern: io.javaoperatorsdk.operator.Operator \ No newline at end of file