diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java b/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java index af8ab555fb57..8692ac9b93b3 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/CommittedChangesProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs; @@ -36,7 +22,11 @@ import java.util.List; */ public interface CommittedChangesProvider extends VcsProviderMarker { @NotNull - U createDefaultSettings(); + default U createDefaultSettings() { + //noinspection unchecked + return (U)new ChangeBrowserSettings(); + } + ChangesBrowserSettingsEditor createFilterUI(final boolean showDateFilter); @Nullable diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/BrowseChangesAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/BrowseChangesAction.java index 345835119c89..b1b790116971 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/BrowseChangesAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/BrowseChangesAction.java @@ -1,19 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.changes.actions; import com.intellij.openapi.actionSystem.AnAction; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java index 1193e46816d9..f918507aff8d 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CompositeCommittedChangesProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.changes.committed; import com.intellij.openapi.actionSystem.AnAction; @@ -46,7 +31,7 @@ import java.util.List; */ public class CompositeCommittedChangesProvider implements CommittedChangesProvider { private final Project myProject; - private List myBaseVcss = new ArrayList<>(); + private List myBaseVcss; public CompositeCommittedChangesProvider(final Project project, final AbstractVcs... baseVcss) { myProject = project; diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java index 7913c5d3e72c..277df7262ea6 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.changes.committed; import com.intellij.openapi.util.Pair; @@ -28,7 +14,6 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.vcs.MockContentRevision; import com.intellij.util.AsynchConsumer; import com.intellij.vcsUtil.VcsUtil; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.DataInput; @@ -43,12 +28,6 @@ public class MockCommittedChangesProvider implements CachingCommittedChangesProv private final List myChangeLists = new ArrayList<>(); private int myRefreshCount = 0; - @NotNull - @Override - public ChangeBrowserSettings createDefaultSettings() { - return new ChangeBrowserSettings(); - } - @Override public ChangesBrowserSettingsEditor createFilterUI(final boolean showDateFilter) { return null; @@ -125,8 +104,8 @@ public class MockCommittedChangesProvider implements CachingCommittedChangesProv return list; } - private CommittedChangeListImpl createList(final String name, final String author, final String comment, - final long date, final long number, final Change... changes) { + private static CommittedChangeListImpl createList(final String name, final String author, final String comment, + final long date, final long number, final Change... changes) { final Collection changeList = new ArrayList<>(); Collections.addAll(changeList, changes); return new CommittedChangeListImpl(name, comment, author, number, new Date(date), changeList); diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java index db8e761d1654..18be4a25b833 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.cvsSupport2.changeBrowser; import com.intellij.CvsBundle; @@ -38,7 +24,6 @@ import com.intellij.openapi.vcs.versionBrowser.ChangesBrowserSettingsEditor; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.AsynchConsumer; -import com.intellij.util.Consumer; import gnu.trove.TObjectLongHashMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -63,11 +48,6 @@ public class CvsCommittedChangesProvider implements CachingCommittedChangesProvi myProject = project; } - @NotNull - public ChangeBrowserSettings createDefaultSettings() { - return new ChangeBrowserSettings(); - } - public ChangesBrowserSettingsEditor createFilterUI(final boolean showDateFilter) { return new CvsVersionFilterComponent(showDateFilter); } diff --git a/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java b/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java index 789d17d2b083..69b365968c9b 100644 --- a/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java +++ b/plugins/git4idea/src/git4idea/changes/GitCommittedChangeListProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package git4idea.changes; import com.intellij.openapi.diagnostic.Logger; @@ -63,11 +49,6 @@ public class GitCommittedChangeListProvider implements CommittedChangesProvider< myProject = project; } - @NotNull - public ChangeBrowserSettings createDefaultSettings() { - return new ChangeBrowserSettings(); - } - public ChangesBrowserSettingsEditor createFilterUI(boolean showDateFilter) { return new GitVersionFilterComponent(showDateFilter); } diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java index 29cab4c98ed3..34c802cf7422 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgCommittedChangesProvider.java @@ -57,11 +57,6 @@ public class HgCommittedChangesProvider implements CommittedChangesProvider createFilterUI(boolean showDateFilter) { return new HgVersionFilterComponent(showDateFilter); } @@ -84,7 +79,7 @@ public class HgCommittedChangesProvider implements CommittedChangesProvider consumer) throws VcsException { + final AsynchConsumer consumer) { try { List results = getCommittedChanges(changeBrowserSettings, repositoryLocation, maxCount); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java index 656cefc77550..c7142cec8404 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.idea.svn.history; @@ -92,12 +78,6 @@ public class SvnCommittedChangesProvider implements CachingCommittedChangesProvi }, project.getDisposed())); } - @Override - @NotNull - public ChangeBrowserSettings createDefaultSettings() { - return new ChangeBrowserSettings(); - } - @Override @NotNull public ChangesBrowserSettingsEditor createFilterUI(boolean showDateFilter) {