From 84e5982e30e9774dd6f6e1b15900d0fef04b48eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=8F=E7=83=88?= Date: Tue, 28 Nov 2017 17:29:58 +0800 Subject: [PATCH 1/4] transactional check pattern for rollbackFor or rollbakOn --- .../java/rule/exception/TransactionMustHaveRollbackRule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p3c-pmd/src/main/java/com/alibaba/p3c/pmd/lang/java/rule/exception/TransactionMustHaveRollbackRule.java b/p3c-pmd/src/main/java/com/alibaba/p3c/pmd/lang/java/rule/exception/TransactionMustHaveRollbackRule.java index 98cc89a..089778a 100644 --- a/p3c-pmd/src/main/java/com/alibaba/p3c/pmd/lang/java/rule/exception/TransactionMustHaveRollbackRule.java +++ b/p3c-pmd/src/main/java/com/alibaba/p3c/pmd/lang/java/rule/exception/TransactionMustHaveRollbackRule.java @@ -37,7 +37,7 @@ public class TransactionMustHaveRollbackRule extends AbstractAliRule { private static final String TRANSACTIONAL_ANNOTATION_NAME = "Transactional"; private static final String TRANSACTIONAL_FULL_NAME = "org.springframework.transaction.annotation." + TRANSACTIONAL_ANNOTATION_NAME; - private static final String ROLLBACK_FOR = "rollbackFor"; + private static final String ROLLBACK_PREFIX = "rollback"; private static final String XPATH_FOR_ROLLBACK = "//StatementExpression/PrimaryExpression" + "/PrimaryPrefix/Name[ends-with(@Image,'rollback')]"; @@ -82,7 +82,7 @@ public class TransactionMustHaveRollbackRule extends AbstractAliRule { private boolean rollbackAttrSet(List memberValuePairList) { for (ASTMemberValuePair pair : memberValuePairList) { - if (ROLLBACK_FOR.equals(pair.getImage())) { + if (pair.getImage() != null && pair.getImage().startsWith(ROLLBACK_PREFIX)) { return true; } } From 35410bea7ca62c811501808ba25dafa6b490e26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=8F=E7=83=88?= Date: Tue, 28 Nov 2017 17:30:53 +0800 Subject: [PATCH 2/4] fix https://github.com/alibaba/p3c/issues/185 --- .../com/alibaba/p3c/idea/inspection/AliPmdInspectionInvoker.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/p3c/idea/inspection/AliPmdInspectionInvoker.kt b/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/p3c/idea/inspection/AliPmdInspectionInvoker.kt index 5fdfab2..de0e755 100644 --- a/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/p3c/idea/inspection/AliPmdInspectionInvoker.kt +++ b/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/p3c/idea/inspection/AliPmdInspectionInvoker.kt @@ -55,7 +55,7 @@ class AliPmdInspectionInvoker( val processor = AliPmdProcessor(rule) val start = System.currentTimeMillis() violations = processor.processFile(psiFile) - logger.info("elapsed ${System.currentTimeMillis() - start}ms to" + + logger.debug("elapsed ${System.currentTimeMillis() - start}ms to" + " to apply rule ${rule.name} for file ${psiFile.virtualFile.canonicalPath}") } From c868d5bb47de15be31da35d0842d8c2964de1528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=8F=E7=83=88?= Date: Wed, 29 Nov 2017 09:57:57 +0800 Subject: [PATCH 3/4] p3c-pmd 1.3.2 idea-plugin 1.0.2 upgrade kotlin version to 1.2.0 --- .../pom.xml | 2 +- .../pom.xml | 31 ------------------- eclipse-plugin/pom.xml | 2 +- idea-plugin/gradle.properties | 2 +- idea-plugin/p3c-common/build.gradle | 4 +-- p3c-pmd/pom.xml | 2 +- 6 files changed, 6 insertions(+), 37 deletions(-) diff --git a/eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml b/eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml index dbf0ad7..3b0852a 100644 --- a/eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml +++ b/eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml @@ -22,7 +22,7 @@ com.alibaba.p3c p3c-pmd - 1.3.1 + 1.3.2 org.jetbrains.kotlin diff --git a/eclipse-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml b/eclipse-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml index 17fa208..e322f1e 100644 --- a/eclipse-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml +++ b/eclipse-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml @@ -10,35 +10,4 @@ com.alibaba.smartfox.eclipse.updatesite eclipse-repository 2017 - - - publish-to-update-site - - - - org.eclipse.tycho.extras - tycho-p2-extras-plugin - - - publish - install - - mirror - - - - - ${project.build.directory}/repository - - - true - ${eclipse.updatesite.path} - - - - - - - - diff --git a/eclipse-plugin/pom.xml b/eclipse-plugin/pom.xml index 92551bf..d0bd2cc 100644 --- a/eclipse-plugin/pom.xml +++ b/eclipse-plugin/pom.xml @@ -14,7 +14,7 @@ http://download.eclipse.org/releases/neon UTF-8 http://download.eclipse.org/tools/ajdt/46/dev/update - 1.1.51 + 1.2.0 juno diff --git a/idea-plugin/gradle.properties b/idea-plugin/gradle.properties index c944d12..89f4e01 100644 --- a/idea-plugin/gradle.properties +++ b/idea-plugin/gradle.properties @@ -1,4 +1,4 @@ -kotlin_version=1.1.51 +kotlin_version=1.2.0 #idea_version=171.3780.15 idea_version=14.1.7 plugin_name=Alibaba Java Coding Guidelines diff --git a/idea-plugin/p3c-common/build.gradle b/idea-plugin/p3c-common/build.gradle index 9d21123..f667643 100644 --- a/idea-plugin/p3c-common/build.gradle +++ b/idea-plugin/p3c-common/build.gradle @@ -32,13 +32,13 @@ intellij { updateSinceUntilBuild false sandboxDirectory "$project.buildDir/idea-sandbox/$idea_version" } -version '1.0.1' +version '1.0.2' ext.isReleaseVersion = !version.endsWith("SNAPSHOT") dependencies { compile group: 'org.freemarker', name: 'freemarker', version: '2.3.25-incubating' - compile 'com.alibaba.p3c:p3c-pmd:1.3.0' + compile 'com.alibaba.p3c:p3c-pmd:1.3.2' compile group: 'org.javassist', name: 'javassist', version: '3.21.0-GA' } diff --git a/p3c-pmd/pom.xml b/p3c-pmd/pom.xml index adee52f..cb947a3 100644 --- a/p3c-pmd/pom.xml +++ b/p3c-pmd/pom.xml @@ -9,7 +9,7 @@ 4.0.0 com.alibaba.p3c p3c-pmd - 1.3.1 + 1.3.2 jar p3c-pmd From 35d8da1fe42a0c472539cab78186cc114ec9c7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=8F=E7=83=88?= Date: Wed, 29 Nov 2017 11:32:29 +0800 Subject: [PATCH 4/4] idea-plugin 1.0.2 --- idea-plugin/gradle.properties | 2 +- idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/idea-plugin/gradle.properties b/idea-plugin/gradle.properties index 89f4e01..0e6a905 100644 --- a/idea-plugin/gradle.properties +++ b/idea-plugin/gradle.properties @@ -6,4 +6,4 @@ pmd_version=5.5.2 gradle_jetbrains_version=0.2.13 systemProp.file.encoding=UTF-8 -plugin_version=1.0.1 +plugin_version=1.0.2 diff --git a/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml b/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml index 8f022b5..1a8d9d9 100755 --- a/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml +++ b/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml @@ -6,6 +6,11 @@ + 1.0.2 +
  • fix https://github.com/alibaba/p3c/issues/185
  • +
  • fix https://github.com/alibaba/p3c/issues/189
  • + +