Skip to content

Commit

Permalink
Update IntelliJ versions: eapOfLatestSupportedMajor to 243.19420.21-E…
Browse files Browse the repository at this point in the history
…AP-SNAPSHOT (#1937)

* Update IntelliJ versions: eapOfLatestSupportedMajor to 243.19420.21-EAP-SNAPSHOT

* Fix ArchUnit tests

---------

Co-authored-by: Pawel Lipski <[email protected]>
  • Loading branch information
git-machete-bot and PawelLipski authored Oct 10, 2024
1 parent 6ae518a commit 8a48f93
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## v5.1.1
- Fixed: compatibility issues with latest 2024.3 EAPs

## v5.1.0
- Added: support for IntelliJ 2024.3.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import static com.virtuslab.gitmachete.frontend.resourcebundles.GitMacheteBundle.getString;
import static org.apache.commons.text.StringEscapeUtils.escapeHtml4;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.VcsNotifier;
import git4idea.GitRemoteBranch;
import git4idea.branch.GitNewBranchOptions;
Expand Down Expand Up @@ -157,6 +159,7 @@ public void actionPerformed(AnActionEvent anActionEvent) {
}

@ContinuesInBackground
@SuppressWarnings("KotlinInternalInJava")
private Tuple2<@Nullable String, UiThreadUnsafeRunnable> getBranchNameAndPreSlideInRunnable(
GitRepository gitRepository,
String startPoint,
Expand Down Expand Up @@ -188,7 +191,26 @@ public void actionPerformed(AnActionEvent anActionEvent) {

if (remoteBranch == null) {
return Tuple.of(branchName, () -> {
val gitBranchCheckoutOperation = new GitBranchCheckoutOperation(project, Collections.singletonList(gitRepository));
// TODO (#1938): replace with a non-reflective call once 2024.2 is no longer supported
Constructor constructor;
try {
// Since 243.19420.21-EAP-SNAPSHOT
constructor = GitBranchCheckoutOperation.class.getConstructor(Project.class, java.util.Collection.class);
} catch (NoSuchMethodException e) {
try {
// Before 243.19420.21-EAP-SNAPSHOT
constructor = GitBranchCheckoutOperation.class.getConstructor(Project.class, java.util.List.class);
} catch (NoSuchMethodException e1) {
throw new RuntimeException(e1);
}
}
GitBranchCheckoutOperation gitBranchCheckoutOperation;
try {
gitBranchCheckoutOperation = (GitBranchCheckoutOperation) constructor.newInstance(project,
Collections.singletonList(gitRepository));
} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
val git4IdeaOptions = options.toGit4IdeaOptions();
try {
// Since 233.10527.20-EAP-SNAPSHOT
Expand All @@ -202,8 +224,8 @@ public void actionPerformed(AnActionEvent anActionEvent) {
throw new RuntimeException(e);
}
} catch (NoSuchMethodException e) {
// Before 233.10527.20-EAP-SNAPSHOT
try {
// Before 233.10527.20-EAP-SNAPSHOT
Method perform = GitBranchCheckoutOperation.class.getDeclaredMethod("perform", String.class,
GitNewBranchOptions.class);
perform.invoke(gitBranchCheckoutOperation, startPoint, git4IdeaOptions);
Expand Down
2 changes: 1 addition & 1 deletion intellij-versions.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eapOfLatestSupportedMajor=243.18137.10-EAP-SNAPSHOT
eapOfLatestSupportedMajor=243.19420.21-EAP-SNAPSHOT
earliestSupportedMajor=2022.3
earliestSupportedMajorKotlinVersion=1.7
latestMinorsOfOldSupportedMajors=2022.3.3,2023.1.7,2023.2.8,2023.3.8,2024.1.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void only_ui_thread_unsafe_code_units_should_call_other_ui_thread_unsafe_
"git4idea.ui.ComboBoxWithAutoCompletion.setPlaceholder(java.lang.String)",
"git4idea.ui.ComboBoxWithAutoCompletion.setPrototypeDisplayValue(java.lang.Object)",
"git4idea.ui.ComboBoxWithAutoCompletion.setUI(javax.swing.plaf.ComboBoxUI)",
"git4idea.ui.branch.GitBranchCheckoutOperation.<init>(com.intellij.openapi.project.Project, java.util.List)",
"git4idea.ui.branch.GitBranchCheckoutOperation.<init>(com.intellij.openapi.project.Project, java.util.Collection)",
"git4idea.validators.GitBranchValidatorKt.checkRefName(java.lang.String)",
"git4idea.validators.GitBranchValidatorKt.checkRefNameEmptyOrHead(java.lang.String)",
"git4idea.validators.GitBranchValidatorKt.conflictsWithLocalBranch(java.util.Collection, java.lang.String)",
Expand Down

0 comments on commit 8a48f93

Please sign in to comment.