Skip to content

Commit

Permalink
Merge pull request alibaba#193 from SeanCai/master
Browse files Browse the repository at this point in the history
 transactional check pattern for rollbackFor or rollbakOn and fix alibaba#185
  • Loading branch information
xuantan authored Nov 29, 2017
2 parents b83c884 + 35d8da1 commit dd05eab
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 41 deletions.
2 changes: 1 addition & 1 deletion eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>com.alibaba.p3c</groupId>
<artifactId>p3c-pmd</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down
31 changes: 0 additions & 31 deletions eclipse-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,4 @@
<artifactId>com.alibaba.smartfox.eclipse.updatesite</artifactId>
<packaging>eclipse-repository</packaging>
<inceptionYear>2017</inceptionYear>
<profiles>
<profile>
<id>publish-to-update-site</id>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<executions>
<execution>
<id>publish</id>
<phase>install</phase>
<goals>
<goal>mirror</goal>
</goals>
<configuration>
<source>
<repository>
<url>${project.build.directory}/repository</url>
</repository>
</source>
<append>true</append>
<destination>${eclipse.updatesite.path}</destination>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion eclipse-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<eclipse-repo.url>http://download.eclipse.org/releases/neon</eclipse-repo.url>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<ajdt-eclipse-repo.url>http://download.eclipse.org/tools/ajdt/46/dev/update</ajdt-eclipse-repo.url>
<kotlin.version>1.1.51</kotlin.version>
<kotlin.version>1.2.0</kotlin.version>
<eclipse-release>juno</eclipse-release>
</properties>
<modules>
Expand Down
4 changes: 2 additions & 2 deletions idea-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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
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
4 changes: 2 additions & 2 deletions idea-plugin/p3c-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
}

Expand Down
5 changes: 5 additions & 0 deletions idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<change-notes>
<![CDATA[
<ul>
1.0.2
<li>fix <a href="https://github.com/alibaba/p3c/issues/185">https://github.com/alibaba/p3c/issues/185</a></li>
<li>fix <a href="https://github.com/alibaba/p3c/issues/189">https://github.com/alibaba/p3c/issues/189</a></li>
</ul>
<ul>
1.0.1
<li>fix <a href="https://github.com/alibaba/p3c/issues/149">https://github.com/alibaba/p3c/issues/149</a></li>
<li>fix <a href="https://github.com/alibaba/p3c/issues/60">https://github.com/alibaba/p3c/issues/60</a></li>
Expand Down
2 changes: 1 addition & 1 deletion p3c-pmd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.alibaba.p3c</groupId>
<artifactId>p3c-pmd</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<packaging>jar</packaging>
<name>p3c-pmd</name>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')]";
Expand Down Expand Up @@ -82,7 +82,7 @@ public Object visit(ASTAnnotation node, Object data) {

private boolean rollbackAttrSet(List<ASTMemberValuePair> memberValuePairList) {
for (ASTMemberValuePair pair : memberValuePairList) {
if (ROLLBACK_FOR.equals(pair.getImage())) {
if (pair.getImage() != null && pair.getImage().startsWith(ROLLBACK_PREFIX)) {
return true;
}
}
Expand Down

0 comments on commit dd05eab

Please sign in to comment.