diff --git a/demo-output.yaml b/demo-output.yaml index 12864c19..8816e0e6 100644 --- a/demo-output.yaml +++ b/demo-output.yaml @@ -156,47 +156,57 @@ matchingXML: |- javaxjavaee-api${javaee-api.version}provided + - uri: file:///analyzer-lsp/examples/java/example/pom.xml + message: |- + javaxjavaee-api${javaee-api.version}provided + variables: + data: dependency + innerText: "\n javax\n javaee-api\n \n ${javaee-api.version}\n provided\n " + matchingXML: |- + javaxjavaee-api${javaee-api.version}provided - uri: file:///analyzer-lsp/examples/java/pom.xml message: io.fabric8kubernetes-client-api6.0.0 codeSnip: |- - 30 4.11 - 31 test - 32 - 33 - 34 io.fabric8 - 35 kubernetes-client - 36 6.0.0 - 37 - 38 - 39 io.fabric8 - 40 kubernetes-client-api - 41 6.0.0 - 42 - 43 - 44 javax - 45 javaee-api - 46 ${javaee-api.version} - 47 provided - 48 - 49 - 50 - lineNumber: 39 + 31 4.11 + 32 test + 33 + 34 + 35 io.fabric8 + 36 kubernetes-client + 37 6.0.0 + 38 + 39 + 40 io.fabric8 + 41 kubernetes-client-api + 42 6.0.0 + 43 + 44 + 45 javax + 46 javaee-api + 47 ${javaee-api.version} + 48 provided + 49 + 50 + 51 + lineNumber: 40 variables: data: dependency innerText: "\n io.fabric8\n kubernetes-client-api\n 6.0.0\n " matchingXML: io.fabric8kubernetes-client-api6.0.0 - uri: file:///analyzer-lsp/examples/java/pom.xml message: io.fabric8kubernetes-client6.0.0 - codeSnip: "25 \n26 \n27 \n28 junit\n29 junit\n30 4.11\n31 test\n32 \n33 \n34 io.fabric8\n35 kubernetes-client\n36 6.0.0\n37 \n38 \n39 io.fabric8\n40 kubernetes-client-api\n41 6.0.0\n42 \n43 \n44 javax\n45 javaee-api" - lineNumber: 34 + codeSnip: "26 \n27 \n28 \n29 junit\n30 junit\n31 4.11\n32 test\n33 \n34 \n35 io.fabric8\n36 kubernetes-client\n37 6.0.0\n38 \n39 \n40 io.fabric8\n41 kubernetes-client-api\n42 6.0.0\n43 \n44 \n45 javax\n46 javaee-api" + lineNumber: 35 variables: data: dependency innerText: "\n io.fabric8\n kubernetes-client\n 6.0.0\n " matchingXML: io.fabric8kubernetes-client6.0.0 - uri: file:///analyzer-lsp/examples/java/pom.xml message: io.nettynetty-transport-native-epoll4.1.76.Finallinux-x86_64runtime - codeSnip: "42 \n43 \n44 javax\n45 javaee-api\n46 ${javaee-api.version}\n47 provided\n48 \n49 \n50 \n51 io.netty\n52 netty-transport-native-epoll\n53 4.1.76.Final\n54 linux-x86_64\n55 runtime\n56 \n57 \n58 \n59 \n60 \n61 \n62 " - lineNumber: 51 + codeSnip: "43 \n44 \n45 javax\n46 javaee-api\n47 ${javaee-api.version}\n48 provided\n49 \n50 \n51 \n52 io.netty\n53 netty-transport-native-epoll\n54 4.1.76.Final\n55 linux-x86_64\n56 runtime\n57 \n58 \n59 \n60 \n61 \n62 \n63 " + lineNumber: 52 variables: data: dependency innerText: "\n io.netty\n netty-transport-native-epoll\n 4.1.76.Final\n linux-x86_64\n runtime\n " @@ -204,36 +214,36 @@ - uri: file:///analyzer-lsp/examples/java/pom.xml message: javaxjavaee-api${javaee-api.version}provided codeSnip: |- - 35 kubernetes-client - 36 6.0.0 - 37 - 38 - 39 io.fabric8 - 40 kubernetes-client-api - 41 6.0.0 - 42 - 43 - 44 javax - 45 javaee-api - 46 ${javaee-api.version} - 47 provided - 48 - 49 - 50 - 51 io.netty - 52 netty-transport-native-epoll - 53 4.1.76.Final - 54 linux-x86_64 - 55 runtime - lineNumber: 44 + 36 kubernetes-client + 37 6.0.0 + 38 + 39 + 40 io.fabric8 + 41 kubernetes-client-api + 42 6.0.0 + 43 + 44 + 45 javax + 46 javaee-api + 47 ${javaee-api.version} + 48 provided + 49 + 50 + 51 + 52 io.netty + 53 netty-transport-native-epoll + 54 4.1.76.Final + 55 linux-x86_64 + 56 runtime + lineNumber: 45 variables: data: dependency innerText: "\n javax\n javaee-api\n ${javaee-api.version}\n provided\n " matchingXML: javaxjavaee-api${javaee-api.version}provided - uri: file:///analyzer-lsp/examples/java/pom.xml message: junitjunit4.11test - codeSnip: "19 \n20 UTF-8\n21 1.7\n22 1.7\n23 7.0\n24 \n25 \n26 \n27 \n28 junit\n29 junit\n30 4.11\n31 test\n32 \n33 \n34 io.fabric8\n35 kubernetes-client\n36 6.0.0\n37 \n38 \n39 io.fabric8" - lineNumber: 28 + codeSnip: "20 \n21 UTF-8\n22 1.7\n23 1.7\n24 7.0\n25 \n26 \n27 \n28 \n29 junit\n30 junit\n31 4.11\n32 test\n33 \n34 \n35 io.fabric8\n36 kubernetes-client\n37 6.0.0\n38 \n39 \n40 io.fabric8" + lineNumber: 29 variables: data: dependency innerText: "\n junit\n junit\n 4.11\n test\n " @@ -297,15 +307,15 @@ incidents: - uri: file:///analyzer-lsp/examples/java/pom.xml message: dependency io.fabric8.kubernetes-client with 6.0.0 is bad and you should feel bad for using it - codeSnip: "25 \n26 \n27 \n28 junit\n29 junit\n30 4.11\n31 test\n32 \n33 \n34 io.fabric8\n35 kubernetes-client\n36 6.0.0\n37 \n38 \n39 io.fabric8\n40 kubernetes-client-api\n41 6.0.0\n42 \n43 \n44 javax\n45 javaee-api" - lineNumber: 34 + codeSnip: "26 \n27 \n28 \n29 junit\n30 junit\n31 4.11\n32 test\n33 \n34 \n35 io.fabric8\n36 kubernetes-client\n37 6.0.0\n38 \n39 \n40 io.fabric8\n41 kubernetes-client-api\n42 6.0.0\n43 \n44 \n45 javax\n46 javaee-api" + lineNumber: 35 variables: name: io.fabric8.kubernetes-client version: 6.0.0 - uri: file:///analyzer-lsp/examples/java/pom.xml message: dependency junit.junit with 4.11 is bad and you should feel bad for using it - codeSnip: "19 \n20 UTF-8\n21 1.7\n22 1.7\n23 7.0\n24 \n25 \n26 \n27 \n28 junit\n29 junit\n30 4.11\n31 test\n32 \n33 \n34 io.fabric8\n35 kubernetes-client\n36 6.0.0\n37 \n38 \n39 io.fabric8" - lineNumber: 28 + codeSnip: "20 \n21 UTF-8\n22 1.7\n23 1.7\n24 7.0\n25 \n26 \n27 \n28 \n29 junit\n30 junit\n31 4.11\n32 test\n33 \n34 \n35 io.fabric8\n36 kubernetes-client\n37 6.0.0\n38 \n39 \n40 io.fabric8" + lineNumber: 29 variables: name: junit.junit version: "4.11" @@ -318,6 +328,55 @@ lineNumber: 10 variables: file: file:///analyzer-lsp/examples/golang/main.go + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + message: apiextensions/v1beta1/customresourcedefinitions is deprecated, apiextensions/v1/customresourcedefinitions should be used instead + codeSnip: " 1 package com.example.apps;\n 2 \n 3 import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition;\n 4 \n 5 public class App \n 6 {\n 7 \n 8 /**\n 9 * {@link CustomResourceDefinition}\n10 * @param args\n11 */\n12 public static void main( String[] args )\n13 {" + lineNumber: 3 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + kind: Module + name: io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + message: apiextensions/v1beta1/customresourcedefinitions is deprecated, apiextensions/v1/customresourcedefinitions should be used instead + codeSnip: " 4 \n 5 public class App \n 6 {\n 7 \n 8 /**\n 9 * {@link CustomResourceDefinition}\n10 * @param args\n11 */\n12 public static void main( String[] args )\n13 {\n14 CustomResourceDefinition crd = new CustomResourceDefinition();\n15 System.out.println( crd );\n16 \n17 GenericClass element = new GenericClass(\"Hello world!\");\n18 element.get();\n19 }\n20 }\n" + lineNumber: 14 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + kind: Method + name: main + lang-ref-003: + description: "" + category: potential + incidents: + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + message: java found apiextensions/v1/customresourcedefinitions found file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java:14 + codeSnip: " 4 \n 5 public class App \n 6 {\n 7 \n 8 /**\n 9 * {@link CustomResourceDefinition}\n10 * @param args\n11 */\n12 public static void main( String[] args )\n13 {\n14 CustomResourceDefinition crd = new CustomResourceDefinition();\n15 System.out.println( crd );\n16 \n17 GenericClass element = new GenericClass(\"Hello world!\");\n18 element.get();\n19 }\n20 }\n" + lineNumber: 14 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + kind: Method + name: main + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + message: java found apiextensions/v1/customresourcedefinitions found file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java:3 + codeSnip: " 1 package com.example.apps;\n 2 \n 3 import io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition;\n 4 \n 5 public class App \n 6 {\n 7 \n 8 /**\n 9 * {@link CustomResourceDefinition}\n10 * @param args\n11 */\n12 public static void main( String[] args )\n13 {" + lineNumber: 3 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + kind: Module + name: io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition + lang-ref-004: + description: "" + category: potential + incidents: + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + message: found generic call + codeSnip: " 8 /**\n 9 * {@link CustomResourceDefinition}\n10 * @param args\n11 */\n12 public static void main( String[] args )\n13 {\n14 CustomResourceDefinition crd = new CustomResourceDefinition();\n15 System.out.println( crd );\n16 \n17 GenericClass element = new GenericClass(\"Hello world!\");\n18 element.get();\n19 }\n20 }\n" + lineNumber: 18 + variables: + VariableName: element + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/App.java + kind: Method + name: main multiple-actions-001: description: "" category: potential @@ -364,6 +423,46 @@ lineNumber: 27 variables: file: file:///analyzer-lsp/examples/python/main.py + singleton-sessionbean-00001: + description: "" + category: potential + incidents: + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + message: condition entries should evaluate out of order + codeSnip: " 1 package com.example.apps;\n 2 \n 3 import javax.ejb.SessionBean;\n 4 import javax.ejb.Singleton;\n 5 \n 6 @Singleton\n 7 public abstract class Bean implements SessionBean {\n 8 }\n" + lineNumber: 6 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + kind: Class + name: Singleton + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + message: condition entries should evaluate out of order + codeSnip: " 1 package com.example.apps;\n 2 \n 3 import javax.ejb.SessionBean;\n 4 import javax.ejb.Singleton;\n 5 \n 6 @Singleton\n 7 public abstract class Bean implements SessionBean {\n 8 }\n" + lineNumber: 7 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + kind: Class + name: Bean + singleton-sessionbean-00002: + description: "" + category: potential + incidents: + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + message: condition entries should evaluate in order + codeSnip: " 1 package com.example.apps;\n 2 \n 3 import javax.ejb.SessionBean;\n 4 import javax.ejb.Singleton;\n 5 \n 6 @Singleton\n 7 public abstract class Bean implements SessionBean {\n 8 }\n" + lineNumber: 6 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + kind: Class + name: Singleton + - uri: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + message: condition entries should evaluate in order + codeSnip: " 1 package com.example.apps;\n 2 \n 3 import javax.ejb.SessionBean;\n 4 import javax.ejb.Singleton;\n 5 \n 6 @Singleton\n 7 public abstract class Bean implements SessionBean {\n 8 }\n" + lineNumber: 7 + variables: + file: file:///analyzer-lsp/examples/java/example/src/main/java/com/example/apps/Bean.java + kind: Class + name: Bean tech-tag-001: description: "" category: potential @@ -529,47 +628,57 @@ matchingXML: |- javaxjavaee-api${javaee-api.version}provided + - uri: file:///analyzer-lsp/examples/java/example/pom.xml + message: |- + POM XML dependencies - 'javaxjavaee-api${javaee-api.version}provided' + variables: + data: dependency + innerText: "\n javax\n javaee-api\n \n ${javaee-api.version}\n provided\n " + matchingXML: |- + javaxjavaee-api${javaee-api.version}provided - uri: file:///analyzer-lsp/examples/java/pom.xml message: POM XML dependencies - 'io.fabric8kubernetes-client-api6.0.0' codeSnip: |- - 30 4.11 - 31 test - 32 - 33 - 34 io.fabric8 - 35 kubernetes-client - 36 6.0.0 - 37 - 38 - 39 io.fabric8 - 40 kubernetes-client-api - 41 6.0.0 - 42 - 43 - 44 javax - 45 javaee-api - 46 ${javaee-api.version} - 47 provided - 48 - 49 - 50 - lineNumber: 39 + 31 4.11 + 32 test + 33 + 34 + 35 io.fabric8 + 36 kubernetes-client + 37 6.0.0 + 38 + 39 + 40 io.fabric8 + 41 kubernetes-client-api + 42 6.0.0 + 43 + 44 + 45 javax + 46 javaee-api + 47 ${javaee-api.version} + 48 provided + 49 + 50 + 51 + lineNumber: 40 variables: data: dependency innerText: "\n io.fabric8\n kubernetes-client-api\n 6.0.0\n " matchingXML: io.fabric8kubernetes-client-api6.0.0 - uri: file:///analyzer-lsp/examples/java/pom.xml message: POM XML dependencies - 'io.fabric8kubernetes-client6.0.0' - codeSnip: "25 \n26 \n27 \n28 junit\n29 junit\n30 4.11\n31 test\n32 \n33 \n34 io.fabric8\n35 kubernetes-client\n36 6.0.0\n37 \n38 \n39 io.fabric8\n40 kubernetes-client-api\n41 6.0.0\n42 \n43 \n44 javax\n45 javaee-api" - lineNumber: 34 + codeSnip: "26 \n27 \n28 \n29 junit\n30 junit\n31 4.11\n32 test\n33 \n34 \n35 io.fabric8\n36 kubernetes-client\n37 6.0.0\n38 \n39 \n40 io.fabric8\n41 kubernetes-client-api\n42 6.0.0\n43 \n44 \n45 javax\n46 javaee-api" + lineNumber: 35 variables: data: dependency innerText: "\n io.fabric8\n kubernetes-client\n 6.0.0\n " matchingXML: io.fabric8kubernetes-client6.0.0 - uri: file:///analyzer-lsp/examples/java/pom.xml message: POM XML dependencies - 'io.nettynetty-transport-native-epoll4.1.76.Finallinux-x86_64runtime' - codeSnip: "42 \n43 \n44 javax\n45 javaee-api\n46 ${javaee-api.version}\n47 provided\n48 \n49 \n50 \n51 io.netty\n52 netty-transport-native-epoll\n53 4.1.76.Final\n54 linux-x86_64\n55 runtime\n56 \n57 \n58 \n59 \n60 \n61 \n62 " - lineNumber: 51 + codeSnip: "43 \n44 \n45 javax\n46 javaee-api\n47 ${javaee-api.version}\n48 provided\n49 \n50 \n51 \n52 io.netty\n53 netty-transport-native-epoll\n54 4.1.76.Final\n55 linux-x86_64\n56 runtime\n57 \n58 \n59 \n60 \n61 \n62 \n63 " + lineNumber: 52 variables: data: dependency innerText: "\n io.netty\n netty-transport-native-epoll\n 4.1.76.Final\n linux-x86_64\n runtime\n " @@ -577,36 +686,36 @@ - uri: file:///analyzer-lsp/examples/java/pom.xml message: POM XML dependencies - 'javaxjavaee-api${javaee-api.version}provided' codeSnip: |- - 35 kubernetes-client - 36 6.0.0 - 37 - 38 - 39 io.fabric8 - 40 kubernetes-client-api - 41 6.0.0 - 42 - 43 - 44 javax - 45 javaee-api - 46 ${javaee-api.version} - 47 provided - 48 - 49 - 50 - 51 io.netty - 52 netty-transport-native-epoll - 53 4.1.76.Final - 54 linux-x86_64 - 55 runtime - lineNumber: 44 + 36 kubernetes-client + 37 6.0.0 + 38 + 39 + 40 io.fabric8 + 41 kubernetes-client-api + 42 6.0.0 + 43 + 44 + 45 javax + 46 javaee-api + 47 ${javaee-api.version} + 48 provided + 49 + 50 + 51 + 52 io.netty + 53 netty-transport-native-epoll + 54 4.1.76.Final + 55 linux-x86_64 + 56 runtime + lineNumber: 45 variables: data: dependency innerText: "\n javax\n javaee-api\n ${javaee-api.version}\n provided\n " matchingXML: javaxjavaee-api${javaee-api.version}provided - uri: file:///analyzer-lsp/examples/java/pom.xml message: POM XML dependencies - 'junitjunit4.11test' - codeSnip: "19 \n20 UTF-8\n21 1.7\n22 1.7\n23 7.0\n24 \n25 \n26 \n27 \n28 junit\n29 junit\n30 4.11\n31 test\n32 \n33 \n34 io.fabric8\n35 kubernetes-client\n36 6.0.0\n37 \n38 \n39 io.fabric8" - lineNumber: 28 + codeSnip: "20 \n21 UTF-8\n22 1.7\n23 1.7\n24 7.0\n25 \n26 \n27 \n28 \n29 junit\n30 junit\n31 4.11\n32 test\n33 \n34 \n35 io.fabric8\n36 kubernetes-client\n37 6.0.0\n38 \n39 \n40 io.fabric8" + lineNumber: 29 variables: data: dependency innerText: "\n junit\n junit\n 4.11\n test\n " @@ -618,7 +727,3 @@ unmatched: - file-002 - lang-ref-002 - - lang-ref-003 - - lang-ref-004 - - singleton-sessionbean-00001 - - singleton-sessionbean-00002 diff --git a/examples/java/example/pom.xml b/examples/java/example/pom.xml new file mode 100644 index 00000000..24bb0c3b --- /dev/null +++ b/examples/java/example/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + com.example.apps + java + 1.0-SNAPSHOT + + + example + + + + javax + javaee-api + + ${javaee-api.version} + provided + + + diff --git a/examples/java/src/main/java/com/example/apps/App.java b/examples/java/example/src/main/java/com/example/apps/App.java similarity index 100% rename from examples/java/src/main/java/com/example/apps/App.java rename to examples/java/example/src/main/java/com/example/apps/App.java diff --git a/examples/java/src/main/java/com/example/apps/Bean.java b/examples/java/example/src/main/java/com/example/apps/Bean.java similarity index 100% rename from examples/java/src/main/java/com/example/apps/Bean.java rename to examples/java/example/src/main/java/com/example/apps/Bean.java diff --git a/examples/java/src/main/java/com/example/apps/GenericClass.java b/examples/java/example/src/main/java/com/example/apps/GenericClass.java similarity index 100% rename from examples/java/src/main/java/com/example/apps/GenericClass.java rename to examples/java/example/src/main/java/com/example/apps/GenericClass.java diff --git a/examples/java/src/test/java/com/example/apps/AppTest.java b/examples/java/example/src/test/java/com/example/apps/AppTest.java similarity index 100% rename from examples/java/src/test/java/com/example/apps/AppTest.java rename to examples/java/example/src/test/java/com/example/apps/AppTest.java diff --git a/examples/java/pom.xml b/examples/java/pom.xml index 6d551026..e39d0517 100644 --- a/examples/java/pom.xml +++ b/examples/java/pom.xml @@ -14,6 +14,7 @@ http://www.example.com dummy + example