Skip to content

Commit 7a15971

Browse files
committed
Release 1.3.1
修复旧版本兼容问题 修复可能的NPE问题
1 parent 6174d29 commit 7a15971

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
## [1.3.1] - 2024-04-19
6+
- 修复 旧版本兼容性问题
7+
- 修复 可能的 NPE 问题
8+
59
## [1.3.0] - 2024-04-15
610
- 新增 新增决策表特性的支持
711
- 新增 类级别和方法级别声明式的统一

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
// Kotlin support
1010
id("org.jetbrains.kotlin.jvm") version "1.6.10"
1111
// Gradle IntelliJ Plugin
12-
id("org.jetbrains.intellij") version "1.12.0"
12+
id("org.jetbrains.intellij") version "1.13.3"
1313
// Gradle Changelog Plugin
1414
id("org.jetbrains.changelog") version "1.3.1"
1515
}

gradle.properties

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,27 @@
44
pluginGroup = top.xystudio.plugin.idea
55
pluginName = LiteFlowX
66
# SemVer format -> https://semver.org
7-
pluginVersion = 1.3.0
7+
pluginVersion = 1.3.1
88

99
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
# for insight into build numbers and IntelliJ Platform versions.
11-
pluginSinceBuild = 203
11+
pluginSinceBuild = 211
1212
pluginUntilBuild = 241.*
1313

1414
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1515
platformType = IU
16-
platformVersion = 2024.1
16+
platformVersion = 2021.1
1717

1818
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1919
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
2020
platformPlugins = com.intellij.java, com.intellij.properties, org.jetbrains.plugins.yaml, org.intellij.intelliLang, JavaScript
2121

22-
# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
23-
javaVersion = 17
22+
# Java language level used to compile sources and to generate the files for -
23+
# Java 11 is required since 2020.3
24+
# Java 17 is required since 2022.2
25+
# Java 21 is required since 2024.2
26+
# https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#platformVersions
27+
javaVersion = 11
2428

2529
# Gradle Releases -> https://github.com/gradle/gradle/releases
2630
gradleVersion = 7.4

src/main/java/top/xystudio/plugin/idea/liteflowx/service/LiteFlowService.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public String getLiteFlowComponentNameByPsiClass(@NotNull PsiClass psiClass, boo
173173
String componentValue = javaService.getAnnotationAttributeValue(psiClass, Annotation.Component, "value");
174174
if (componentValue != null){
175175
/* 如果获取的value值为空,则默认使用字符串首字母小写的Class名称 */
176-
if (componentValue.equals("")){
176+
if (componentValue.isEmpty()){
177177
componentValue = StringUtils.lowerFirst(className);
178178
}
179179
return componentValue;
@@ -187,7 +187,7 @@ public String getLiteFlowComponentNameByPsiClass(@NotNull PsiClass psiClass, boo
187187
String name = StringUtil.isEmpty(liteFlowComponentValue)? liteFlowComponentId : liteFlowComponentValue;
188188
if (name != null){
189189
/* 如果获取的value或者id值为空,则默认使用字符串首字母小写的Class名称 */
190-
if (name.equals("")){
190+
if (name.isEmpty()){
191191
name = StringUtils.lowerFirst(className);
192192
}
193193
return name;
@@ -200,10 +200,11 @@ public String getLiteFlowComponentNameByPsiClass(@NotNull PsiClass psiClass, boo
200200
for (Node node : nodes.getNodeList()) {
201201
String clazzValue = node.getClazz().getStringValue();
202202
String idValue = node.getId().getStringValue();
203-
if (psiClass.getQualifiedName()==null || clazzValue == null || idValue==null) {
203+
String psiClassQualifiedName = psiClass.getQualifiedName();
204+
if (psiClassQualifiedName == null || clazzValue == null || idValue == null) {
204205
continue;
205206
}
206-
if (psiClass.getQualifiedName().equals(clazzValue)){
207+
if (psiClassQualifiedName.equals(clazzValue)){
207208
return idValue;
208209
}
209210
}
@@ -213,8 +214,12 @@ public String getLiteFlowComponentNameByPsiClass(@NotNull PsiClass psiClass, boo
213214
}
214215

215216
private boolean _isLiteFlow(PsiElement psiElement, String clazz, String nodeTypeEnum){
216-
if (psiElement instanceof PsiClass psiClass){
217+
if (psiElement instanceof PsiClass){
218+
PsiClass psiClass = (PsiClass) psiElement;
217219
// 判断是否类组件
220+
if (psiClass.getQualifiedName() == null){
221+
return false;
222+
}
218223
// 排除所有包名以 com.yomahub.liteflow.core. 开头的Class
219224
if (psiClass.getQualifiedName().indexOf("com.yomahub.liteflow.core.") == 0){
220225
return false;
@@ -232,8 +237,12 @@ private boolean _isLiteFlow(PsiElement psiElement, String clazz, String nodeType
232237
return false;
233238
}
234239
return nodeTypeEnum.equals(nodeType.split("\\(")[0]);
235-
} else if (psiElement instanceof PsiMethod psiMethod) {
240+
} else if (psiElement instanceof PsiMethod) {
241+
PsiMethod psiMethod = (PsiMethod) psiElement;
236242
// 判断是否方法声明组件
243+
if (psiMethod.getContainingClass() == null || psiMethod.getContainingClass().getQualifiedName() == null){
244+
return false;
245+
}
237246
// 排除所有包名以 com.yomahub.liteflow.core. 开头的Class
238247
if (psiMethod.getContainingClass().getQualifiedName().indexOf("com.yomahub.liteflow.core.") == 0){
239248
return false;

src/main/java/top/xystudio/plugin/idea/liteflowx/system/provider/FileIconProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ private Icon getLiteFlowFileIcon(PsiElement element) {
3434
if (!language.isKindOf(JavaLanguage.INSTANCE)){
3535
return null;
3636
}
37-
if (!(element instanceof PsiClass psiClass)){
37+
if (!(element instanceof PsiClass)){
3838
return null;
3939
}
4040

41+
PsiClass psiClass = (PsiClass) element;
42+
4143
Icon icon = getIcon(psiClass);
4244
if (icon != null){
4345
return icon;

0 commit comments

Comments
 (0)