diff --git a/demo-output.yaml b/demo-output.yaml index 9d0873a3..9237d636 100644 --- a/demo-output.yaml +++ b/demo-output.yaml @@ -934,7 +934,7 @@ category: mandatory incidents: - uri: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java - message: Annotation instpection 01 + message: Annotation inspection 01 codeSnip: "17 import org.springframework.transaction.annotation.EnableTransactionManagement;\n18 \n19 import io.konveyor.demo.config.ApplicationConfiguration;\n20 \n21 @Configuration\n22 @EnableJpaRepositories(basePackages = {\n23 \"io.konveyor.demo.ordermanagement.repository\"\n24 })\n25 @EnableTransactionManagement\n26 @EnableSpringDataWebSupport\n27 public class PersistenceConfig {\n28 \n29 \n30 \t@Bean\n31 public LocalContainerEntityManagerFactoryBean entityManagerFactory() {\n32 final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();\n33 em.setDataSource(dataSource());\n34 em.setPackagesToScan(\"io.konveyor.demo.ordermanagement.model\");\n35 em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());\n36 em.setJpaProperties(additionalProperties());\n37 " lineNumber: 27 variables: @@ -948,7 +948,7 @@ category: mandatory incidents: - uri: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java - message: Annotation instpection 02 + message: Annotation inspection 02 codeSnip: "46 dataSource.setUrl(config.getProperty(\"jdbc.url\"));\n47 dataSource.setUsername(config.getProperty(\"jdbc.user\"));\n48 dataSource.setPassword(config.getProperty(\"jdbc.password\"));\n49 \n50 return dataSource;\n51 }\n52 \n53 @Bean\n54 public PlatformTransactionManager transactionManager() {\n55 final JpaTransactionManager transactionManager = new JpaTransactionManager();\n56 transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());\n57 return transactionManager;\n58 }\n59 \n60 @Bean\n61 public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {\n62 return new PersistenceExceptionTranslationPostProcessor();\n63 }\n64 \n65 final Properties additionalProperties() {\n66 \tApplicationConfiguration config = new ApplicationConfiguration();" lineNumber: 56 variables: @@ -962,14 +962,42 @@ category: mandatory incidents: - uri: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/controller/CustomerController.java - message: Annotation instpection 03 - codeSnip: "11 import org.springframework.web.bind.annotation.GetMapping;\n12 import org.springframework.web.bind.annotation.PathVariable;\n13 import org.springframework.web.bind.annotation.RequestMapping;\n14 import org.springframework.web.bind.annotation.RestController;\n15 \n16 @RestController\n17 @RequestMapping(\"/customers\")\n18 public class CustomerController {\n19 \t\n20 \t@Autowired\n21 \tprivate CustomerService customerService;\n22 \t\n23 \tprivate static Logger logger = Logger.getLogger( CustomerController.class.getName() );\n24 \t\n25 \t@GetMapping(value = \"/{id}\", produces = MediaType.APPLICATION_JSON_VALUE)\n26 public Customer getById(@PathVariable(\"id\") Long id) {\n27 \t\tCustomer c = customerService.findById(id);\n28 \t\tif (c == null) {\n29 \t\t\tthrow new ResourceNotFoundException(\"Requested order doesn't exist\");\n30 \t\t}\n31 \t\tlogger.debug(\"Returning element: \" + c);" + message: Annotation inspection 03 + codeSnip: "11 import org.springframework.web.bind.annotation.GetMapping;\n12 import org.springframework.web.bind.annotation.PathVariable;\n13 import org.springframework.web.bind.annotation.RequestMapping;\n14 import org.springframework.web.bind.annotation.RestController;\n15 \n16 @RestController\n17 @RequestMapping(\"/customers\")\n18 public class CustomerController {\n19 \t\n20 \t@Autowired\n21 \tprivate CustomerService customerService;\n22 \t\n23 \tprivate static Logger logger = Logger.getLogger( CustomerController.class.getName() );\n24 \t\n25 \t@GetMapping(value = \"id\", produces = MediaType.APPLICATION_JSON_VALUE)\n26 public Customer getById(@PathVariable(\"id\") Long id) {\n27 \t\tCustomer c = customerService.findById(id);\n28 \t\tif (c == null) {\n29 \t\t\tthrow new ResourceNotFoundException(\"Requested order doesn't exist\");\n30 \t\t}\n31 \t\tlogger.debug(\"Returning element: \" + c);" lineNumber: 21 variables: file: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/controller/CustomerController.java kind: Field name: customerService package: io.konveyor.demo.ordermanagement.controller + java-annotation-inspection-04: + description: | + This rule looks for a given annotation used with some given properties (elements) + category: mandatory + incidents: + - uri: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/controller/CustomerController.java + message: Annotation inspection 04 + codeSnip: "15 \n16 @RestController\n17 @RequestMapping(\"/customers\")\n18 public class CustomerController {\n19 \t\n20 \t@Autowired\n21 \tprivate CustomerService customerService;\n22 \t\n23 \tprivate static Logger logger = Logger.getLogger( CustomerController.class.getName() );\n24 \t\n25 \t@GetMapping(value = \"id\", produces = MediaType.APPLICATION_JSON_VALUE)\n26 public Customer getById(@PathVariable(\"id\") Long id) {\n27 \t\tCustomer c = customerService.findById(id);\n28 \t\tif (c == null) {\n29 \t\t\tthrow new ResourceNotFoundException(\"Requested order doesn't exist\");\n30 \t\t}\n31 \t\tlogger.debug(\"Returning element: \" + c);\n32 \t\treturn c;\n33 \t}\n34 \t\n35 \t@RequestMapping" + lineNumber: 25 + variables: + file: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/controller/CustomerController.java + kind: Method + name: GetMapping + package: io.konveyor.demo.ordermanagement.controller + java-annotation-inspection-05: + description: | + This rule looks for a given annotation used with another annotation + category: mandatory + incidents: + - uri: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java + message: Annotation inspection 05 + codeSnip: "11 import org.springframework.data.web.config.EnableSpringDataWebSupport;\n12 import org.springframework.jdbc.datasource.DriverManagerDataSource;\n13 import org.springframework.orm.jpa.JpaTransactionManager;\n14 import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;\n15 import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;\n16 import org.springframework.transaction.PlatformTransactionManager;\n17 import org.springframework.transaction.annotation.EnableTransactionManagement;\n18 \n19 import io.konveyor.demo.config.ApplicationConfiguration;\n20 \n21 @Configuration\n22 @EnableJpaRepositories(basePackages = {\n23 \"io.konveyor.demo.ordermanagement.repository\"\n24 })\n25 @EnableTransactionManagement\n26 @EnableSpringDataWebSupport\n27 public class PersistenceConfig {\n28 \n29 \n30 \t@Bean\n31 public LocalContainerEntityManagerFactoryBean entityManagerFactory() {" + lineNumber: 21 + variables: + file: file:///examples/customers-tomcat-legacy/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java + kind: Class + name: Configuration + package: io.konveyor.demo.ordermanagement.config java-downloaded-maven-artifact: description: | This rule tests the application downloaded from maven artifact