Skip to content

Commit 0ef55a3

Browse files
authored
Merge pull request #45 from xdev-software/develop
Release 1.0.5
2 parents f323327 + 3c58f43 commit 0ef55a3

11 files changed

+46
-40
lines changed

.github/workflows/update-from-template.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ jobs:
8181
echo "abort=0" >> $GITHUB_OUTPUT
8282
8383
- name: pull-request
84-
uses: repo-sync/pull-request@v2
8584
if: steps.main.outputs.abort == 0
86-
with:
87-
github_token: ${{ secrets.GITHUB_TOKEN }}
88-
source_branch: ${{ env.UPDATE_BRANCH }}
89-
destination_branch: ${{ steps.main.outputs.current_branch }}
90-
pr_title: "Update from template"
91-
pr_body: "An automated PR to sync changes from the template into this repo"
92-
85+
env:
86+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
run: |
88+
gh_pr_up() {
89+
gh pr create -H "${{ env.UPDATE_BRANCH }}" "$@" || git checkout "${{ env.UPDATE_BRANCH }}" && gh pr edit "$@"
90+
}
91+
gh_pr_up -B "${{ steps.main.outputs.current_branch }}" \
92+
--title "Update from template" \
93+
--body "An automated PR to sync changes from the template into this repo"

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.0.5
2+
* Fixed ``Add class qualifier to static member access outside declaring class`` not working in combination with Qodana plugin #25
3+
14
## 1.0.4
25
* Fixed pluginIcon being not displayed #35
36
* Improved support of Android Studio (until a 2023 version is released) #27

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
22
id 'java'
33
id 'idea'
4-
id 'org.jetbrains.intellij' version '1.15.0'
5-
id 'org.sonarqube' version '4.4.0.3356'
4+
id 'org.jetbrains.intellij' version '1.16.0'
5+
id 'org.sonarqube' version '4.4.1.3373'
66
}
77

88
def properties(String key) {
@@ -27,7 +27,7 @@ repositories {
2727

2828
// Add dependencies to test, junit5 api (annotations) and engine (runtime)
2929
dependencies {
30-
testImplementation platform('org.junit:junit-bom:5.10.0'),
30+
testImplementation platform('org.junit:junit-bom:5.10.1'),
3131
'org.junit.jupiter:junit-jupiter',
3232
'org.junit.jupiter:junit-jupiter-engine',
3333
'org.assertj:assertj-core:3.24.2'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ platformVersion=2023.1
1010
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
1111
platformPlugins=java
1212
# Gradle Releases -> https://github.com/gradle/gradle/releases
13-
gradleVersion=8.1.1
13+
gradleVersion=8.4
1414
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
1515
org.gradle.configuration-cache=true
1616
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html

gradle/wrapper/gradle-wrapper.jar

1.61 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

gradlew

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8788

8889
# Use the maximum available, or set MAX_FD != -1 to use that value.
8990
MAX_FD=maximum
@@ -130,26 +131,29 @@ location of your Java installation."
130131
fi
131132
else
132133
JAVACMD=java
133-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134137
135138
Please set the JAVA_HOME variable in your environment to match the
136139
location of your Java installation."
140+
fi
137141
fi
138142

139143
# Increase the maximum file descriptors if we can.
140144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
141145
case $MAX_FD in #(
142146
max*)
143147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
144-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
145149
MAX_FD=$( ulimit -H -n ) ||
146150
warn "Could not query maximum file descriptor limit"
147151
esac
148152
case $MAX_FD in #(
149153
'' | soft) :;; #(
150154
*)
151155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
152-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
153157
ulimit -n "$MAX_FD" ||
154158
warn "Could not set maximum file descriptor limit to $MAX_FD"
155159
esac
@@ -198,11 +202,11 @@ fi
198202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200204

201-
# Collect all arguments for the java command;
202-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
203-
# shell script including quotes and variable substitutions, so put them in
204-
# double quotes to make sure that they get re-expanded; and
205-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
206210

207211
set -- \
208212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

src/main/java/software/xdev/saveactions/processors/java/JavaProcessor.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
package software.xdev.saveactions.processors.java;
22

3-
import software.xdev.saveactions.core.ExecutionMode;
4-
import software.xdev.saveactions.model.Action;
5-
import software.xdev.saveactions.processors.Processor;
6-
import software.xdev.saveactions.processors.SaveWriteCommand;
7-
import software.xdev.saveactions.processors.java.inspection.CustomLocalCanBeFinal;
8-
import software.xdev.saveactions.processors.java.inspection.SerializableHasSerialVersionUIDFieldInspectionWrapper;
93
import com.intellij.codeInspection.ExplicitTypeCanBeDiamondInspection;
104
import com.intellij.codeInspection.LocalInspectionTool;
11-
import software.xdev.saveactions.processors.java.inspection.CustomAccessCanBeTightenedInspection;
125
import com.intellij.codeInspection.visibility.VisibilityInspection;
136
import com.intellij.openapi.project.Project;
147
import com.intellij.psi.PsiFile;
@@ -17,7 +10,6 @@
1710
import com.siyeh.ig.maturity.SuppressionAnnotationInspection;
1811
import com.siyeh.ig.performance.MethodMayBeStaticInspection;
1912
import com.siyeh.ig.style.ControlFlowStatementWithoutBracesInspection;
20-
import software.xdev.saveactions.processors.java.inspection.CustomUnqualifiedStaticUsageInspection;
2113
import com.siyeh.ig.style.FieldMayBeFinalInspection;
2214
import com.siyeh.ig.style.SingleStatementInBlockInspection;
2315
import com.siyeh.ig.style.UnnecessaryFinalOnLocalVariableOrParameterInspection;
@@ -26,6 +18,14 @@
2618
import com.siyeh.ig.style.UnqualifiedFieldAccessInspection;
2719
import com.siyeh.ig.style.UnqualifiedMethodAccessInspection;
2820
import com.siyeh.ig.style.UnqualifiedStaticUsageInspection;
21+
import software.xdev.saveactions.core.ExecutionMode;
22+
import software.xdev.saveactions.model.Action;
23+
import software.xdev.saveactions.processors.Processor;
24+
import software.xdev.saveactions.processors.SaveWriteCommand;
25+
import software.xdev.saveactions.processors.java.inspection.CustomAccessCanBeTightenedInspection;
26+
import software.xdev.saveactions.processors.java.inspection.CustomLocalCanBeFinal;
27+
import software.xdev.saveactions.processors.java.inspection.SerializableHasSerialVersionUIDFieldInspectionWrapper;
28+
import software.xdev.saveactions.processors.java.inspection.style.CustomUnqualifiedStaticUsageInspection;
2929

3030
import java.util.Arrays;
3131
import java.util.EnumSet;

src/main/java/software/xdev/saveactions/processors/java/inspection/CustomSerializableHasSerialVersionUidFieldInspection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
*/
2020
public class CustomSerializableHasSerialVersionUidFieldInspection extends USerializableInspectionBase {
2121

22-
2322
@SuppressWarnings("unchecked")
2423
public CustomSerializableHasSerialVersionUidFieldInspection() {
25-
super(new Class[]{UClass.class});
24+
super(UClass.class);
2625
}
2726

2827
@Override

src/main/java/software/xdev/saveactions/processors/java/inspection/SerializableHasSerialVersionUIDFieldInspectionWrapper.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package software.xdev.saveactions.processors.java.inspection;
22

3-
import software.xdev.saveactions.core.service.SaveActionsService;
43
import com.intellij.codeInspection.LocalInspectionTool;
54
import com.intellij.openapi.diagnostic.Logger;
5+
import software.xdev.saveactions.core.service.SaveActionsService;
66

77
import java.lang.reflect.InvocationTargetException;
88
import java.util.Arrays;
@@ -31,11 +31,7 @@ public static LocalInspectionTool get() {
3131

3232
private enum SerializableClass {
3333
CLASS_NAME_INTELLIJ_2021_3("com.intellij.codeInspection.SerializableHasSerialVersionUidFieldInspection",
34-
"software.xdev.saveactions.processors.java.inspection.CustomSerializableHasSerialVersionUidFieldInspection"),
35-
CLASS_NAME_INTELLIJ_2018_3("com.siyeh.ig.serialization.SerializableHasSerialVersionUIDFieldInspection",
36-
"com.siyeh.ig.serialization.SerializableHasSerialVersionUIDFieldInspection"),
37-
CLASS_NAME_INTELLIJ_2016("com.siyeh.ig.serialization.SerializableHasSerialVersionUIDFieldInspectionBase",
38-
"com.siyeh.ig.serialization.SerializableHasSerialVersionUIDFieldInspectionBase");
34+
"software.xdev.saveactions.processors.java.inspection.CustomSerializableHasSerialVersionUidFieldInspection");
3935

4036
/**
4137
* Field className: Inspection class provided by IDE
@@ -61,7 +57,8 @@ public LocalInspectionTool getInspectionInstance() {
6157
Class.forName(targetClass).asSubclass(LocalInspectionTool.class);
6258
LOGGER.info(String.format("Found serial version uid class %s", targetInspectionClass.getName()));
6359
return targetInspectionClass.cast(targetInspectionClass.getDeclaredConstructor().newInstance());
64-
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
60+
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException
61+
| InvocationTargetException e) {
6562
return null;
6663
}
6764
}

0 commit comments

Comments
 (0)