今天在使用Sonar qube 检测代码的时候,报了一个错,错误信息为:
Cannot use the diamond generic notation when running in JDK inferior to 1.7 mode!
后在网上查了一下,是因为在sonar-project.properties 这份配置文件中,没有明确指定 JDK 版本的原因。所以,须像如下一样进行指定:
# setting the java class version sonar.java.source=1.7
然后就可以啦!
附: stack信息为:
09:02:47.184 INFO - Sensor PmdSensor... 09:02:47.187 INFO - Execute PMD 4.3... 09:02:47.226 INFO - Java version: 1.5 09:02:47.271 INFO - PMD configuration: D:\ppp\.sonar\pmd.xml 09:02:48.465 ERROR - Fail to execute PMD. Following file is ignored: D:\ppp\src\com\ppm\dao\implement\ParentInfo_DAL.java net.sourceforge.pmd.ast.ParseException: Cannot use the diamond generic notation when running in JDK inferior to 1.7 mode! at net.sourceforge.pmd.ast.JavaParser.checkForBadDiamondUsage(JavaParser.java:75) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.TypeArguments(JavaParser.java:2017) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ClassOrInterfaceType(JavaParser.java:1945) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.AllocationExpression(JavaParser.java:3875) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.PrimaryPrefix(JavaParser.java:3535) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.PrimaryExpression(JavaParser.java:3433) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.PostfixExpression(JavaParser.java:3337) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.UnaryExpressionNotPlusMinus(JavaParser.java:3237) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.UnaryExpression(JavaParser.java:3098) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.MultiplicativeExpression(JavaParser.java:2989) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.AdditiveExpression(JavaParser.java:2934) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ShiftExpression(JavaParser.java:2881) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.RelationalExpression(JavaParser.java:2816) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.InstanceOfExpression(JavaParser.java:2779) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.EqualityExpression(JavaParser.java:2724) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.AndExpression(JavaParser.java:2683) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ExclusiveOrExpression(JavaParser.java:2642) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.InclusiveOrExpression(JavaParser.java:2601) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ConditionalAndExpression(JavaParser.java:2560) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ConditionalOrExpression(JavaParser.java:2519) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ConditionalExpression(JavaParser.java:2479) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Expression(JavaParser.java:2340) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.VariableInitializer(JavaParser.java:1278) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.VariableDeclarator(JavaParser.java:1180) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.LocalVariableDeclaration(JavaParser.java:4269) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.BlockStatement(JavaParser.java:4198) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Block(JavaParser.java:4162) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Statement(JavaParser.java:4025) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.IfStatement(JavaParser.java:4517) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Statement(JavaParser.java:4061) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.BlockStatement(JavaParser.java:4201) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Block(JavaParser.java:4162) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Statement(JavaParser.java:4025) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.IfStatement(JavaParser.java:4517) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Statement(JavaParser.java:4061) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.BlockStatement(JavaParser.java:4201) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Block(JavaParser.java:4162) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Statement(JavaParser.java:4025) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.IfStatement(JavaParser.java:4522) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Statement(JavaParser.java:4061) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.BlockStatement(JavaParser.java:4201) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.Block(JavaParser.java:4162) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.MethodDeclaration(JavaParser.java:1416) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ClassOrInterfaceBodyDeclaration(JavaParser.java:1085) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ClassOrInterfaceBody(JavaParser.java:1004) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.ClassOrInterfaceDeclaration(JavaParser.java:514) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.TypeDeclaration(JavaParser.java:406) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.ast.JavaParser.CompilationUnit(JavaParser.java:164) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.parsers.Java15Parser.parse(Java15Parser.java:24) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.PMD.processFile(PMD.java:98) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.PMD.processFile(PMD.java:75) ~[pmd-4.3.jar:na] at net.sourceforge.pmd.PMD.processFile(PMD.java:210) ~[pmd-4.3.jar:na] at org.sonar.plugins.pmd.PmdTemplate.process(PmdTemplate.java:71) ~[sonar-pmd-plugin-1.5.jar:na] at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:100) [sonar-pmd-plugin-1.5.jar:na] at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:75) [sonar-pmd-plugin-1.5.jar:na] at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:61) [sonar-pmd-plugin-1.5.jar:na] at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:52) [sonar-pmd-plugin-1.5.jar:na] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:150) [sonar-batch-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:211) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:206) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:199) [sonar-batch-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:58) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82) [sonar-batch-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:144) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:132) [sonar-batch-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.1.1.jar:na] at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92) [sonar-batch-4.1.1.jar:na] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74) [sonar-batch-4.1.1.jar:na] at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45) [sonar-runner-batch6119497299030140902.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_13] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_13] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_13] at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_13] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) [sonar-runner-dist-2.3.jar:na] at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) [sonar-runner-dist-2.3.jar:na] at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_13] at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-runner-dist-2.3.jar:na] at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-runner-dist-2.3.jar:na] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-runner-dist-2.3.jar:na] at org.sonar.runner.api.Runner.execute(Runner.java:90) [sonar-runner-dist-2.3.jar:na] at org.sonar.runner.Main.executeTask(Main.java:70) [sonar-runner-dist-2.3.jar:na] at org.sonar.runner.Main.execute(Main.java:59) [sonar-runner-dist-2.3.jar:na] at org.sonar.runner.Main.main(Main.java:41) [sonar-runner-dist-2.3.jar:na]
相关推荐
The JavaScript Object Notation (JSON) Data Interchange Format,RFC 8259,
We typically use probabilistic analysis to determine the running time of an algorithm in cases in which, due to the presence of an inherent probability distribution, the running time may differ on ...
Its purpose is more to ensure that your use of notation matches that in this book than to teach you new mathematical concepts. Chapter 4 delves further into the divide-and-conquer method introduced ...
Max messages that allows the user to populate a score with notes, query note properties, transform notes, play a score through Max/MSP via a well-defined instrument interface, and export a score in a ...
Long ago, when Alexander the Great asked the mathematician Menaechmus for a crash course in geometry, he got the famous reply ``There is no royal road to mathematics.’’ Where there was no shortcut ...
Addison.Wesley.Aspect.Oriented.Software.Development.with.Use.Cases ...Modeling use-cases slices and aspects using the newest extensions to the UML notation Applying use cases and aspects in projects
Instead of using the cell notation, it is possible to use the M-file FAC2LET (factors to letters) to extract components; e.g. [A,B,C] = fac2let(Factors); MISSING DATA For all algorithms the same ...
Introduction to JavaScript Object Notation - Early Release
The use of spatial vector notation greatly reduces the volume of algebra which allows systems to be described using fewer equations and fewer quantities. It also allows problems to be solved in fewer...
When networking protocols were being developed in the 1960s through the 1980s, expensive, dedicated hardware was required to see the packets going "across the wire." Extreme familiarity with the ...
written in code to be displayed in dialogs to the user at runtime. Chapter 15 rounds off the advanced techniques by thoroughly covering properties, including internationalization both in the normal ...
such as the use of function boxes in the first two chapters to visually distinguish functions from data, use of evaltrace notation in later chapters to illustrate the operation of evaluation rules, ...
Within the notation summary in Appendix B, magenta annotations on diagrams can be clicked to jump to the referenced articles. The Adobe Reader previous view arrow can be used to restore a previous ...
such as the use of function boxes in the first two chapters to visually distinguish functions from data, use of evaltrace notation in later chapters to illustrate the operation of evaluation rules, ...
the Generic SNMP Trace window is particularly useful for debugging when developing an SNMP agent and for resolving problems when MIB Browser cannot properly query an SNMP agent. The enclosed MIB ...
In the Windows environment, multiple applications that use the tablet may be running at once. Each ap-plication will require different services. Applications must be able to get the services they need...
Secondly, it aims to provide clear guidance on current best practice in the use of the notation for those concerned with the development and evaluation of engineering arguments – argument owners, ...
For each of these techniques, the book presents templates and guidelines on when to use and not to use each technique. The third major section of the book covers NP-completeness and the inherent ...
companies are working on processes to provide advice on the use of UML in the software development life cycle. The OMG presented the “Software Process Engineering Metamodel” (SPEM) as a standard in ...