Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wangsun300
p3c
提交
3e32532e
P
p3c
项目概览
wangsun300
/
p3c
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
p3c
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3e32532e
编写于
3月 15, 2018
作者:
S
SeanCai
提交者:
GitHub
3月 15, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #255 from SeanCai/master
pr for bug fix and new version
上级
a79cb7ec
d9a69279
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
38 addition
and
16 deletion
+38
-16
eclipse-plugin/com.alibaba.smartfox.eclipse.feature/feature.xml
...e-plugin/com.alibaba.smartfox.eclipse.feature/feature.xml
+1
-1
eclipse-plugin/com.alibaba.smartfox.eclipse.feature/pom.xml
eclipse-plugin/com.alibaba.smartfox.eclipse.feature/pom.xml
+1
-1
eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/META-INF/MANIFEST.MF
.../com.alibaba.smartfox.eclipse.plugin/META-INF/MANIFEST.MF
+1
-1
eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml
eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml
+2
-2
eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/src/main/kotlin/com/alibaba/smartfox/eclipse/pmd/rule/AvoidAccessStaticViaInstanceRule.kt
...tfox/eclipse/pmd/rule/AvoidAccessStaticViaInstanceRule.kt
+21
-4
eclipse-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml
...se-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml
+1
-1
eclipse-plugin/pom.xml
eclipse-plugin/pom.xml
+2
-2
idea-plugin/gradle.properties
idea-plugin/gradle.properties
+2
-2
idea-plugin/p3c-common/build.gradle
idea-plugin/p3c-common/build.gradle
+1
-1
idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml
idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml
+5
-0
p3c-pmd/pom.xml
p3c-pmd/pom.xml
+1
-1
未找到文件。
eclipse-plugin/com.alibaba.smartfox.eclipse.feature/feature.xml
浏览文件 @
3e32532e
...
...
@@ -2,7 +2,7 @@
<feature
id=
"com.alibaba.smartfox.eclipse.feature"
label=
"%feature.label"
version=
"1.0.
3
.qualifier"
version=
"1.0.
4
.qualifier"
provider-name=
"%feature.provider_name"
plugin=
"com.alibaba.smartfox.eclipse.plugin"
image=
"smartfox.png"
>
...
...
eclipse-plugin/com.alibaba.smartfox.eclipse.feature/pom.xml
浏览文件 @
3e32532e
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.alibaba.smartfox.eclipse
</groupId>
<artifactId>
smartfox-eclipse
</artifactId>
<version>
1.0.
3
-SNAPSHOT
</version>
<version>
1.0.
4
-SNAPSHOT
</version>
</parent>
<artifactId>
com.alibaba.smartfox.eclipse.feature
</artifactId>
<packaging>
eclipse-feature
</packaging>
...
...
eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/META-INF/MANIFEST.MF
浏览文件 @
3e32532e
...
...
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.alibaba.smartfox.eclipse.plugin
Bundle-SymbolicName: com.alibaba.smartfox.eclipse.plugin;singleton:=true
Bundle-Version: 1.0.
3
.qualifier
Bundle-Version: 1.0.
4
.qualifier
Bundle-Activator: com.alibaba.smartfox.eclipse.SmartfoxActivator
Bundle-Vendor: Alibaba
Require-Bundle: org.eclipse.ui,
...
...
eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/pom.xml
浏览文件 @
3e32532e
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.alibaba.smartfox.eclipse
</groupId>
<artifactId>
smartfox-eclipse
</artifactId>
<version>
1.0.
3
-SNAPSHOT
</version>
<version>
1.0.
4
-SNAPSHOT
</version>
</parent>
<artifactId>
com.alibaba.smartfox.eclipse.plugin
</artifactId>
<packaging>
eclipse-plugin
</packaging>
...
...
@@ -22,7 +22,7 @@
<dependency>
<groupId>
com.alibaba.p3c
</groupId>
<artifactId>
p3c-pmd
</artifactId>
<version>
1.3.
3
</version>
<version>
1.3.
4
</version>
</dependency>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
...
...
eclipse-plugin/com.alibaba.smartfox.eclipse.plugin/src/main/kotlin/com/alibaba/smartfox/eclipse/pmd/rule/AvoidAccessStaticViaInstanceRule.kt
浏览文件 @
3e32532e
...
...
@@ -35,7 +35,8 @@ class AvoidAccessStaticViaInstanceRule : AbstractEclipseRule() {
override
fun
getVisitor
(
ast
:
CompilationUnit
,
ruleContext
:
RuleContext
):
ASTVisitor
{
return
object
:
ASTVisitor
()
{
override
fun
visit
(
node
:
QualifiedName
?):
Boolean
{
if
(
node
!!
.
parent
!
is
MethodInvocation
&&
node
.
parent
!
is
VariableDeclarationFragment
)
{
val
parent
=
node
!!
.
parent
if
(
parent
!
is
MethodInvocation
&&
parent
!
is
VariableDeclarationFragment
)
{
return
false
}
val
name
=
node
.
name
...
...
@@ -45,9 +46,25 @@ class AvoidAccessStaticViaInstanceRule : AbstractEclipseRule() {
}
val
qualifier
=
node
.
qualifier
val
typeBinding
=
qualifier
.
resolveTypeBinding
()
if
(
qualifier
.
isSimpleName
&&
typeBinding
.
name
!=
qualifier
.
fullyQualifiedName
)
{
violation
(
ruleContext
,
node
,
ast
)
return
false
if
(
qualifier
.
isSimpleName
)
{
when
(
parent
)
{
is
MethodInvocation
->
{
val
methodBinding
=
parent
.
resolveMethodBinding
()
val
methodTypeBinding
=
methodBinding
.
declaringClass
if
(
methodBinding
.
modifiers
and
Modifier
.
STATIC
!=
0
&&
qualifier
.
fullyQualifiedName
!=
methodTypeBinding
.
name
&&
methodTypeBinding
==
typeBinding
&&
binding
.
name
!=
typeBinding
.
name
)
{
violation
(
ruleContext
,
parent
,
ast
)
return
false
}
}
else
->
{
}
}
if
(
typeBinding
.
name
!=
qualifier
.
fullyQualifiedName
)
{
violation
(
ruleContext
,
node
,
ast
)
return
false
}
}
if
(
qualifier
.
isQualifiedName
)
{
val
qualifiedName
=
qualifier
as
QualifiedName
...
...
eclipse-plugin/com.alibaba.smartfox.eclipse.updatesite/pom.xml
浏览文件 @
3e32532e
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.alibaba.smartfox.eclipse
</groupId>
<artifactId>
smartfox-eclipse
</artifactId>
<version>
1.0.
3
-SNAPSHOT
</version>
<version>
1.0.
4
-SNAPSHOT
</version>
</parent>
<artifactId>
com.alibaba.smartfox.eclipse.updatesite
</artifactId>
<packaging>
eclipse-repository
</packaging>
...
...
eclipse-plugin/pom.xml
浏览文件 @
3e32532e
...
...
@@ -5,7 +5,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.alibaba.smartfox.eclipse
</groupId>
<artifactId>
smartfox-eclipse
</artifactId>
<version>
1.0.
3
-SNAPSHOT
</version>
<version>
1.0.
4
-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<inceptionYear>
2017
</inceptionYear>
<properties>
...
...
@@ -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.2.
0
</kotlin.version>
<kotlin.version>
1.2.
21
</kotlin.version>
<eclipse-release>
juno
</eclipse-release>
</properties>
<modules>
...
...
idea-plugin/gradle.properties
浏览文件 @
3e32532e
kotlin_version
=
1.2.
0
kotlin_version
=
1.2.
21
#idea_version=171.3780.15
idea_version
=
14.1.7
plugin_name
=
Alibaba Java Coding Guidelines
...
...
@@ -6,4 +6,4 @@ pmd_version=5.5.2
gradle_jetbrains_version
=
0.2.13
systemProp.file.encoding
=
UTF-8
plugin_version
=
1.0.
3
plugin_version
=
1.0.
4
idea-plugin/p3c-common/build.gradle
浏览文件 @
3e32532e
...
...
@@ -38,7 +38,7 @@ 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.
3
'
compile
'com.alibaba.p3c:p3c-pmd:1.3.
4
'
compile
group:
'org.javassist'
,
name:
'javassist'
,
version:
'3.21.0-GA'
}
...
...
idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml
浏览文件 @
3e32532e
...
...
@@ -5,6 +5,11 @@
<change-notes>
<![CDATA[
<ul>
1.0.4
<li>
fix https://github.com/alibaba/p3c/issues/217
</li>
<li>
fix https://github.com/alibaba/p3c/issues/208
</li>
<li>
fix https://github.com/alibaba/p3c/issues/195
</li>
<ul>
1.0.3
<li>
fix
<a
href=
"https://github.com/alibaba/p3c/issues/191"
>
https://github.com/alibaba/p3c/issues/191
</a></li>
...
...
p3c-pmd/pom.xml
浏览文件 @
3e32532e
...
...
@@ -9,7 +9,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.alibaba.p3c
</groupId>
<artifactId>
p3c-pmd
</artifactId>
<version>
1.3.
3
</version>
<version>
1.3.
4
</version>
<packaging>
jar
</packaging>
<name>
p3c-pmd
</name>
<properties>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录