Skip to content

Commit 8a48f93

Browse files
Update IntelliJ versions: eapOfLatestSupportedMajor to 243.19420.21-EAP-SNAPSHOT (#1937)
* Update IntelliJ versions: eapOfLatestSupportedMajor to 243.19420.21-EAP-SNAPSHOT * Fix ArchUnit tests --------- Co-authored-by: Pawel Lipski <[email protected]>
1 parent 6ae518a commit 8a48f93

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

CHANGE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## v5.1.1
4+
- Fixed: compatibility issues with latest 2024.3 EAPs
45

56
## v5.1.0
67
- Added: support for IntelliJ 2024.3.

frontend/actions/src/main/java/com/virtuslab/gitmachete/frontend/actions/base/BaseSlideInBelowAction.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
import static com.virtuslab.gitmachete.frontend.resourcebundles.GitMacheteBundle.getString;
88
import static org.apache.commons.text.StringEscapeUtils.escapeHtml4;
99

10+
import java.lang.reflect.Constructor;
1011
import java.lang.reflect.InvocationTargetException;
1112
import java.lang.reflect.Method;
1213
import java.util.Collections;
1314

1415
import com.intellij.openapi.actionSystem.AnActionEvent;
1516
import com.intellij.openapi.application.ApplicationManager;
17+
import com.intellij.openapi.project.Project;
1618
import com.intellij.openapi.vcs.VcsNotifier;
1719
import git4idea.GitRemoteBranch;
1820
import git4idea.branch.GitNewBranchOptions;
@@ -157,6 +159,7 @@ public void actionPerformed(AnActionEvent anActionEvent) {
157159
}
158160

159161
@ContinuesInBackground
162+
@SuppressWarnings("KotlinInternalInJava")
160163
private Tuple2<@Nullable String, UiThreadUnsafeRunnable> getBranchNameAndPreSlideInRunnable(
161164
GitRepository gitRepository,
162165
String startPoint,
@@ -188,7 +191,26 @@ public void actionPerformed(AnActionEvent anActionEvent) {
188191

189192
if (remoteBranch == null) {
190193
return Tuple.of(branchName, () -> {
191-
val gitBranchCheckoutOperation = new GitBranchCheckoutOperation(project, Collections.singletonList(gitRepository));
194+
// TODO (#1938): replace with a non-reflective call once 2024.2 is no longer supported
195+
Constructor constructor;
196+
try {
197+
// Since 243.19420.21-EAP-SNAPSHOT
198+
constructor = GitBranchCheckoutOperation.class.getConstructor(Project.class, java.util.Collection.class);
199+
} catch (NoSuchMethodException e) {
200+
try {
201+
// Before 243.19420.21-EAP-SNAPSHOT
202+
constructor = GitBranchCheckoutOperation.class.getConstructor(Project.class, java.util.List.class);
203+
} catch (NoSuchMethodException e1) {
204+
throw new RuntimeException(e1);
205+
}
206+
}
207+
GitBranchCheckoutOperation gitBranchCheckoutOperation;
208+
try {
209+
gitBranchCheckoutOperation = (GitBranchCheckoutOperation) constructor.newInstance(project,
210+
Collections.singletonList(gitRepository));
211+
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
212+
throw new RuntimeException(e);
213+
}
192214
val git4IdeaOptions = options.toGit4IdeaOptions();
193215
try {
194216
// Since 233.10527.20-EAP-SNAPSHOT
@@ -202,8 +224,8 @@ public void actionPerformed(AnActionEvent anActionEvent) {
202224
throw new RuntimeException(e);
203225
}
204226
} catch (NoSuchMethodException e) {
205-
// Before 233.10527.20-EAP-SNAPSHOT
206227
try {
228+
// Before 233.10527.20-EAP-SNAPSHOT
207229
Method perform = GitBranchCheckoutOperation.class.getDeclaredMethod("perform", String.class,
208230
GitNewBranchOptions.class);
209231
perform.invoke(gitBranchCheckoutOperation, startPoint, git4IdeaOptions);

intellij-versions.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
eapOfLatestSupportedMajor=243.18137.10-EAP-SNAPSHOT
1+
eapOfLatestSupportedMajor=243.19420.21-EAP-SNAPSHOT
22
earliestSupportedMajor=2022.3
33
earliestSupportedMajorKotlinVersion=1.7
44
latestMinorsOfOldSupportedMajors=2022.3.3,2023.1.7,2023.2.8,2023.3.8,2024.1.6

src/test/java/com/virtuslab/archunit/UIThreadUnsafeMethodInvocationsTestSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public void only_ui_thread_unsafe_code_units_should_call_other_ui_thread_unsafe_
144144
"git4idea.ui.ComboBoxWithAutoCompletion.setPlaceholder(java.lang.String)",
145145
"git4idea.ui.ComboBoxWithAutoCompletion.setPrototypeDisplayValue(java.lang.Object)",
146146
"git4idea.ui.ComboBoxWithAutoCompletion.setUI(javax.swing.plaf.ComboBoxUI)",
147-
"git4idea.ui.branch.GitBranchCheckoutOperation.<init>(com.intellij.openapi.project.Project, java.util.List)",
147+
"git4idea.ui.branch.GitBranchCheckoutOperation.<init>(com.intellij.openapi.project.Project, java.util.Collection)",
148148
"git4idea.validators.GitBranchValidatorKt.checkRefName(java.lang.String)",
149149
"git4idea.validators.GitBranchValidatorKt.checkRefNameEmptyOrHead(java.lang.String)",
150150
"git4idea.validators.GitBranchValidatorKt.conflictsWithLocalBranch(java.util.Collection, java.lang.String)",

0 commit comments

Comments
 (0)