mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup: method can be static, title capitalization
This commit is contained in:
@@ -61,7 +61,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
/**
|
||||
* Prohibits committing with an empty messages, warns if committing into detached HEAD, checks if user name and correct CRLF attributes
|
||||
* are set.
|
||||
* @author Kirill Likhodedov
|
||||
*/
|
||||
public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
|
||||
@@ -77,7 +76,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
return new MyCheckinHandler(panel);
|
||||
}
|
||||
|
||||
private class MyCheckinHandler extends CheckinHandler {
|
||||
private static class MyCheckinHandler extends CheckinHandler {
|
||||
@NotNull private final CheckinProjectPanel myPanel;
|
||||
@NotNull private final Project myProject;
|
||||
|
||||
@@ -119,7 +118,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
final Collection<VirtualFile> files = myPanel.getVirtualFiles(); // deleted files aren't included, but for them we don't care about CRLFs.
|
||||
final AtomicReference<GitCrlfProblemsDetector> crlfHelper = new AtomicReference<>();
|
||||
ProgressManager.getInstance().run(
|
||||
new Task.Modal(myProject, "Checking for line separator issues...", true) {
|
||||
new Task.Modal(myProject, "Checking for Line Separator Issues", true) {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
crlfHelper.set(GitCrlfProblemsDetector.detect(GitCheckinHandlerFactory.MyCheckinHandler.this.myProject,
|
||||
@@ -211,11 +210,11 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Map<VirtualFile, Couple<String>> getDefinedUserNames(@NotNull final Project project,
|
||||
@NotNull final Collection<VirtualFile> roots,
|
||||
final boolean stopWhenFoundFirst) {
|
||||
private static Map<VirtualFile, Couple<String>> getDefinedUserNames(@NotNull final Project project,
|
||||
@NotNull final Collection<VirtualFile> roots,
|
||||
final boolean stopWhenFoundFirst) {
|
||||
final Map<VirtualFile, Couple<String>> defined = ContainerUtil.newHashMap();
|
||||
ProgressManager.getInstance().run(new Task.Modal(project, "Checking Git user name...", true) {
|
||||
ProgressManager.getInstance().run(new Task.Modal(project, "Checking Git User Name", true) {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator pi) {
|
||||
for (VirtualFile root : roots) {
|
||||
@@ -276,7 +275,8 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Couple<String> getUserNameAndEmailFromGitConfig(@NotNull Project project, @NotNull VirtualFile root) throws VcsException {
|
||||
private static Couple<String> getUserNameAndEmailFromGitConfig(@NotNull Project project,
|
||||
@NotNull VirtualFile root) throws VcsException {
|
||||
String name = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_NAME);
|
||||
String email = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_EMAIL);
|
||||
return Couple.of(name, email);
|
||||
@@ -339,11 +339,12 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean commitOrCommitAndPush(@Nullable CommitExecutor executor) {
|
||||
private static boolean commitOrCommitAndPush(@Nullable CommitExecutor executor) {
|
||||
return executor == null || executor instanceof GitCommitAndPushExecutor;
|
||||
}
|
||||
|
||||
private String readMore(String link, String message) {
|
||||
@NotNull
|
||||
private static String readMore(@NotNull String link, @NotNull String message) {
|
||||
return String.format("<a href='%s'>%s</a>.", link, message);
|
||||
}
|
||||
|
||||
@@ -381,7 +382,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
return result;
|
||||
}
|
||||
|
||||
private class DetachedRoot {
|
||||
private static class DetachedRoot {
|
||||
final VirtualFile myRoot;
|
||||
final boolean myRebase; // rebase in progress, or just detached due to a checkout of a commit.
|
||||
|
||||
@@ -390,7 +391,5 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
myRebase = rebase;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user