Remove unnecessary throws declaration in VCS modules

This commit is contained in:
Kirill Likhodedov
2017-08-30 10:36:56 +03:00
parent ca9fffa746
commit 226679d0b9
181 changed files with 390 additions and 469 deletions

View File

@@ -23,7 +23,6 @@ import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.help.HelpManager;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
@@ -378,13 +377,7 @@ public class UnscrambleDialog extends DialogWrapper {
@Override
protected void doOKAction() {
if (myConfigurable != null && myConfigurable.isModified()) {
try {
myConfigurable.apply();
}
catch (ConfigurationException e) {
setText(e.getMessage());
return;
}
myConfigurable.apply();
}
DumbService.getInstance(myProject).withAlternativeResolveEnabled(() -> {
if (performUnscramble()) {

View File

@@ -77,7 +77,7 @@ public class SimpleDiffRequestChain extends UserDataHolderBase implements DiffRe
@NotNull
@Override
public DiffRequest process(@NotNull UserDataHolder context, @NotNull ProgressIndicator indicator)
throws DiffRequestProducerException, ProcessCanceledException {
throws ProcessCanceledException {
return myRequest;
}
}

View File

@@ -68,13 +68,13 @@ public class DiffErrorElement extends DiffElement {
}
@Override
public DiffElement[] getChildren() throws IOException {
public DiffElement[] getChildren() {
return EMPTY_ARRAY;
}
@Nullable
@Override
public byte[] getContent() throws IOException {
public byte[] getContent() {
return null;
}

View File

@@ -127,7 +127,7 @@ public abstract class ApplicationStarterBase extends ApplicationStarterEx {
}
@Nullable
public static VirtualFile findFile(@NotNull String path, @Nullable String currentDirectory) throws IOException {
public static VirtualFile findFile(@NotNull String path, @Nullable String currentDirectory) {
File file = getFile(path, currentDirectory);
VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
if (virtualFile == null) {

View File

@@ -284,13 +284,13 @@ public abstract class MergeModelBase<S extends MergeModelBase.State> implements
}
@Override
public final void undo() throws UnexpectedUndoException {
public final void undo() {
MergeModelBase model = myModelRef.get();
if (model != null && myUndo) restoreStates(model);
}
@Override
public final void redo() throws UnexpectedUndoException {
public final void redo() {
MergeModelBase model = myModelRef.get();
if (model != null && !myUndo) restoreStates(model);
}

View File

@@ -129,7 +129,7 @@ public class BinaryMergeRequestImpl extends BinaryMergeRequest {
if (applyContent != null) {
new WriteCommandAction.Simple(null) {
@Override
protected void run() throws Throwable {
protected void run() {
try {
VirtualFile file = myFile.getFile();
if (!DiffUtil.makeWritable(myProject, file)) throw new IOException("File is read-only: " + file.getPresentableName());

View File

@@ -59,7 +59,7 @@ public class DiffSettingsConfigurable implements SearchableConfigurable {
}
@Override
public void apply() throws ConfigurationException {
public void apply() {
if (mySettingsPane != null) {
mySettingsPane.apply();
}

View File

@@ -59,7 +59,7 @@ public class ExternalDiffSettingsConfigurable implements SearchableConfigurable
}
@Override
public void apply() throws ConfigurationException {
public void apply() {
if (mySettingsPane != null) {
mySettingsPane.apply();
}

View File

@@ -185,12 +185,12 @@ class DirDiffViewer implements FrameDiffTool.DiffViewer {
}
@Override
public DiffElement[] getChildren() throws IOException {
public DiffElement[] getChildren() {
return EMPTY_ARRAY;
}
@Override
public byte[] getContent() throws IOException {
public byte[] getContent() {
return null;
}

View File

@@ -64,7 +64,7 @@ public class BinaryPatchContentParser {
private static void getContent(@NotNull ListIterator<String> iterator,
@NotNull ByteArrayOutputStream afterStream, @NotNull String lenFromLiteral)
throws EofBinaryPatchSyntaxException, IOException, BinaryEncoder.BinaryPatchException {
throws EofBinaryPatchSyntaxException, BinaryEncoder.BinaryPatchException {
long afterSize = Long.parseLong(lenFromLiteral);
checkNotEOF(iterator);
BinaryEncoder.decode(iterator, afterSize, afterStream);

View File

@@ -19,7 +19,7 @@ package com.intellij.openapi.vcs;
* author: lesya
*/
public interface TransactionProvider extends VcsProviderMarker {
void startTransaction(Object parameters) throws VcsException;
void startTransaction(Object parameters);
void commitTransaction(Object parameters) throws VcsException;
void rollbackTransaction(Object parameters);

View File

@@ -56,7 +56,7 @@ public class RepositoryLocationGroup implements RepositoryLocation {
}
@Override
public void onBeforeBatch() throws VcsException {
public void onBeforeBatch() {
}
@Override

View File

@@ -53,7 +53,7 @@ public class CurrentRevision implements VcsFileRevision {
return new Date(myFile.getTimeStamp());
}
public byte[] getContent() throws IOException, VcsException {
public byte[] getContent() {
try {
Document document = ReadAction.compute(() -> FileDocumentManager.getInstance().getDocument(myFile));
if (document != null) {

View File

@@ -57,7 +57,7 @@ public interface VcsFileRevision extends VcsFileContent, VcsRevisionDescription
return getContent();
}
public byte[] getContent() throws IOException, VcsException {
public byte[] getContent() {
return ArrayUtil.EMPTY_BYTE_ARRAY;
}
};

View File

@@ -220,7 +220,7 @@ public class ContentRevisionCache {
private static VcsRevisionNumber putIntoCurrentCache(final ContentRevisionCache cache,
FilePath path,
@NotNull VcsKey vcsKey,
final CurrentRevisionProvider loader) throws VcsException, IOException {
final CurrentRevisionProvider loader) throws VcsException {
VcsRevisionNumber loadedRevisionNumber;
Pair<VcsRevisionNumber, Long> currentRevision;

View File

@@ -28,5 +28,5 @@ import java.io.IOException;
*/
public interface CurrentRevisionProvider {
VcsRevisionNumber getCurrentRevision() throws VcsException;
Pair<VcsRevisionNumber, byte[]> get() throws VcsException, IOException;
Pair<VcsRevisionNumber, byte[]> get() throws VcsException;
}

View File

@@ -32,5 +32,5 @@ public interface VcsHistoryProviderEx extends VcsHistoryProvider {
void reportAppendableHistory(@NotNull FilePath path,
@Nullable VcsRevisionNumber startingRevision,
@NotNull VcsAppendableHistorySessionPartner partner) throws VcsException;
@NotNull VcsAppendableHistorySessionPartner partner);
}

View File

@@ -188,7 +188,7 @@ public class ConversionServiceImpl extends ConversionService {
return false;
}
private static List<ConversionRunner> getSortedConverters(final ConversionContextImpl context) throws CannotConvertException {
private static List<ConversionRunner> getSortedConverters(final ConversionContextImpl context) {
final CachedConversionResult conversionResult = loadCachedConversionResult(context.getProjectFile());
final Map<String, Long> oldMap = conversionResult.myProjectFilesTimestamps;
Map<String, Long> newMap = getProjectFilesMap(context);

View File

@@ -241,7 +241,7 @@ public class PathsVerifier<BinaryType extends FilePatch> {
return true;
}
protected boolean check() throws IOException {
protected boolean check() {
final VirtualFile beforeFile = myBaseMapper.getFile(myPatch, myBeforeName);
if (! checkExistsAndValid(beforeFile, myBeforeName)) {
return false;

View File

@@ -94,7 +94,7 @@ public class VcsCurrentRevisionProxy implements ByteBackedContentRevision {
}
@Override
public Pair<VcsRevisionNumber, byte[]> get() throws VcsException, IOException {
public Pair<VcsRevisionNumber, byte[]> get() throws VcsException {
return loadContent();
}
});

View File

@@ -39,5 +39,5 @@ public interface ChangeDiffRequestProvider {
@NotNull
DiffRequest process(@NotNull ChangeDiffRequestProducer presentable,
@NotNull UserDataHolder context,
@NotNull ProgressIndicator indicator) throws DiffRequestProducerException, ProcessCanceledException;
@NotNull ProgressIndicator indicator) throws ProcessCanceledException;
}

View File

@@ -172,7 +172,7 @@ public abstract class ChangeGoToChangePopupAction<Chain extends DiffRequestChain
@Nullable
@Override
public String getContent() throws VcsException {
public String getContent() {
return null;
}

View File

@@ -109,7 +109,7 @@ public class MigrateToNewDiffUtil {
@NotNull
@Override
public DiffRequest process(@NotNull UserDataHolder context, @NotNull ProgressIndicator indicator)
throws DiffRequestProducerException, ProcessCanceledException {
throws ProcessCanceledException {
return new ErrorDiffRequest(this, "Can't convert from old-style request");
}
}

View File

@@ -15,7 +15,6 @@
*/
package com.intellij.openapi.vcs.changes.committed;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.vcs.VcsBundle;
@@ -27,28 +26,22 @@ import javax.swing.*;
*/
public class CacheSettingsDialog extends DialogWrapper {
private final CacheSettingsPanel myPanel;
private final Project myProject;
public CacheSettingsDialog(Project project) {
super(project, false);
myProject = project;
setTitle(VcsBundle.message("cache.settings.dialog.title"));
myPanel = new CacheSettingsPanel();
myPanel.initPanel(project);
myPanel.reset();
init();
}
protected JComponent createCenterPanel() {
return myPanel.getPanel();
}
protected void doOKAction() {
try {
myPanel.apply();
}
catch (ConfigurationException e) {
//ignore
}
myPanel.apply();
super.doOKAction();
}

View File

@@ -49,7 +49,7 @@ public class CacheSettingsPanel implements Configurable {
myCache = CommittedChangesCache.getInstance(project);
}
public void apply() throws ConfigurationException {
public void apply() {
final CommittedChangesCache.State state = new CommittedChangesCache.State();
state.setInitialCount(((SpinnerNumberModel)myCountSpinner.getModel()).getNumber().intValue());
state.setInitialDays(((SpinnerNumberModel)myDaysSpinner.getModel()).getNumber().intValue());

View File

@@ -91,14 +91,14 @@ public class CompositeCommittedChangesProvider implements CommittedChangesProvid
}
public List<CommittedChangeList> getCommittedChanges(CompositeCommittedChangesProvider.CompositeChangeBrowserSettings settings,
RepositoryLocation location, final int maxCount) throws VcsException {
RepositoryLocation location, final int maxCount) {
throw new UnsupportedOperationException();
}
public void loadCommittedChanges(CompositeChangeBrowserSettings settings,
RepositoryLocation location,
int maxCount,
AsynchConsumer<CommittedChangeList> consumer) throws VcsException {
AsynchConsumer<CommittedChangeList> consumer) {
throw new UnsupportedOperationException();
}

View File

@@ -36,8 +36,7 @@ public class MockDelayingChangeProvider implements ChangeProvider {
}
public void getChanges(@NotNull final VcsDirtyScope dirtyScope, @NotNull final ChangelistBuilder builder, @NotNull final ProgressIndicator progress,
@NotNull final ChangeListManagerGate addGate)
throws VcsException {
@NotNull final ChangeListManagerGate addGate) {
synchronized (myLock) {
if (myExecuteInsideUpdate == null) {
return;

View File

@@ -42,7 +42,7 @@ public class BinaryFilePatchInProgress extends CommonBinaryFilePatchInProgress<B
return new SimpleBinaryContentRevision(newFilePath) {
@Nullable
@Override
public byte[] getBinaryContent() throws VcsException {
public byte[] getBinaryContent() {
return myPatch.getAfterContent();
}
};

View File

@@ -135,7 +135,7 @@ public class ApplyPatchMergeRequest extends MergeRequest implements ApplyPatchRe
if (applyContent != null) {
new WriteCommandAction.Simple(myProject) {
@Override
protected void run() throws Throwable {
protected void run() {
myResultContent.getDocument().setText(applyContent);
}
}.execute();

View File

@@ -41,7 +41,7 @@ public abstract class SimpleBinaryContentRevision implements BinaryContentRevisi
@Nullable
@Override
public String getContent() throws VcsException {
public String getContent() {
throw new IllegalStateException();
}

View File

@@ -57,7 +57,7 @@ public class ShelfProjectConfigurable implements SearchableConfigurable {
}
@Override
public void apply() throws ConfigurationException {
public void apply() {
ObjectUtils.assertNotNull(myShelfConfigPanel).apply();
}

View File

@@ -51,7 +51,7 @@ public class VcsContentAnnotationConfigurable extends VcsCheckBoxWithSpinnerConf
}
@Override
public void apply() throws ConfigurationException {
public void apply() {
VcsContentAnnotationSettings settings = VcsContentAnnotationSettings.getInstance(myProject);
settings.setShow(myHighlightRecentlyChanged.isSelected());
settings.setLimit(((Number)myHighlightInterval.getValue()).intValue());

View File

@@ -100,7 +100,7 @@ public class VcsGeneralConfigurationPanel {
ShowFilePathAction.getFileManagerName() + " after creation:");
}
public void apply() throws ConfigurationException {
public void apply() {
VcsConfiguration settings = VcsConfiguration.getInstance(myProject);

View File

@@ -51,7 +51,7 @@ public class VcsLimitHistoryConfigurable extends VcsCheckBoxWithSpinnerConfigura
}
@Override
public void apply() throws ConfigurationException {
public void apply() {
myConfiguration.LIMIT_HISTORY = myHighlightRecentlyChanged.isSelected();
myConfiguration.MAXIMUM_HISTORY_ROWS = ((Number) myHighlightInterval.getValue()).intValue();
}

View File

@@ -99,7 +99,7 @@ class VcsUpdateInfoScopeFilterConfigurable implements Configurable, NamedScopesH
}
@Override
public void apply() throws ConfigurationException {
public void apply() {
myVcsConfiguration.UPDATE_FILTER_SCOPE_NAME = getScopeFilterName();
}

View File

@@ -204,7 +204,7 @@ public class GetVersionAction extends AnAction implements DumbAware {
new WriteCommandAction.Simple(myProject) {
@Override
protected void run() throws Throwable {
protected void run() {
try {
write(myFilePath, revisionContent, myProject);
}

View File

@@ -347,12 +347,7 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
boolean transactionSupported = transactionProvider != null;
if (transactionSupported) {
try {
transactionProvider.startTransaction(vcsParameters);
}
catch (VcsException e) {
return Collections.singletonList(e);
}
transactionProvider.startTransaction(vcsParameters);
}
runnable.run(exceptions);

View File

@@ -101,7 +101,7 @@ public abstract class AbstractVcsVirtualFile extends VirtualFile {
@Override
@NotNull
public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) throws IOException {
public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) {
throw new RuntimeException(VcsFileSystem.COULD_NOT_IMPLEMENT_MESSAGE);
}

View File

@@ -63,7 +63,7 @@ public class ContentRevisionVirtualFile extends AbstractVcsVirtualFile {
}
@NotNull
public byte[] contentsToByteArray() throws IOException {
public byte[] contentsToByteArray() {
if (myContentLoadFailed || myProcessingBeforeContentsChange) {
return ArrayUtil.EMPTY_BYTE_ARRAY;
}

View File

@@ -38,7 +38,7 @@ public class VcsVirtualFolder extends AbstractVcsVirtualFile {
}
@NotNull
public byte[] contentsToByteArray() throws IOException {
public byte[] contentsToByteArray() {
throw new RuntimeException(VcsBundle.message("exception.text.internal.error.method.should.not.be.called"));
}
}

View File

@@ -59,7 +59,7 @@ public class BodyLimitInspectionOptions implements ConfigurableUi<Project> {
}
@Override
public void apply(@NotNull Project project) throws ConfigurationException {
public void apply(@NotNull Project project) {
VcsConfiguration settings = VcsConfiguration.getInstance(project);
myInspection.RIGHT_MARGIN = myMarginSpinner.getNumber();

View File

@@ -47,7 +47,7 @@ public class SubjectLimitInspectionOptions implements ConfigurableUi<Project> {
}
@Override
public void apply(@NotNull Project project) throws ConfigurationException {
public void apply(@NotNull Project project) {
myInspection.RIGHT_MARGIN = myMarginSpinner.getNumber();
}

View File

@@ -120,7 +120,7 @@ public class VcsLogFileRevision extends VcsFileRevisionEx {
@Nullable
@Override
public byte[] getContent() throws IOException, VcsException {
public byte[] getContent() {
return myContent;
}

View File

@@ -43,7 +43,7 @@ public class VcsLogFeaturesCollector extends AbstractProjectsUsagesCollector {
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
if (projectLog != null) {
VcsLogUiImpl ui = projectLog.getMainLogUi();

View File

@@ -45,7 +45,7 @@ public class VcsLogRepoSizeCollector extends AbstractProjectsUsagesCollector {
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
VcsLogData logData = projectLog.getDataManager();
if (logData != null) {

View File

@@ -62,7 +62,7 @@ public class EmptyPool implements ConnectionPoolI {
return myRepository;
}
public void verify(IStreamLogger streamLogger) throws AuthenticationException {
public void verify(IStreamLogger streamLogger) {
}
public void open(IStreamLogger streamLogger) throws AuthenticationException {
@@ -77,7 +77,7 @@ public class EmptyPool implements ConnectionPoolI {
}
}
public void close() throws IOException {
public void close() {
try {
mySession.close();
}

View File

@@ -53,7 +53,7 @@ public class SshPasswordAuthentication implements SshAuthentication {
if (methods.contains(KEYBOARD_METHOD)) {
final boolean wasAuthenticated = connection.authenticateWithKeyboardInteractive(myLogin, new InteractiveCallback() {
public String[] replyToChallenge(String s, String instruction, int numPrompts, String[] strings, boolean[] booleans) throws Exception {
public String[] replyToChallenge(String s, String instruction, int numPrompts, String[] strings, boolean[] booleans) {
final String[] result = new String[numPrompts];
if (numPrompts > 0) {
Arrays.fill(result, password);

View File

@@ -64,7 +64,7 @@ public class SshSessionConnection implements IConnection {
return myRepository;
}
public void verify(IStreamLogger streamLogger) throws AuthenticationException {
public void verify(IStreamLogger streamLogger) {
}
public void open(IStreamLogger streamLogger) throws AuthenticationException {
@@ -80,7 +80,7 @@ public class SshSessionConnection implements IConnection {
myState = LifeStages.CREATED;
}
public void close() throws IOException {
public void close() {
myState = LifeStages.CLOSING;
SshLogger.debug("session set to closing; closing streams...");
try {

View File

@@ -195,7 +195,7 @@ public class ReadThread implements Runnable {
return myLastIndex - myFirstIndex;
}
public synchronized void close() throws IOException {
public synchronized void close() {
myIsClosed = true;
if (myAtEndOfStream) return;
myAtEndOfStream = true;

View File

@@ -59,7 +59,7 @@ class Cvs2Configurable implements Configurable {
return !myComponent.equalsTo(getCvsConfiguration(), getAppLevelConfiguration());
}
public void apply() throws ConfigurationException {
public void apply() {
myComponent.saveTo(getCvsConfiguration(), getAppLevelConfiguration());
}

View File

@@ -33,11 +33,11 @@ public class CvsStandardOperationsProvider {
myProject = project;
}
public void checkinFile(String path, Object parameters, Map userData) throws VcsException {
public void checkinFile(String path, Object parameters, Map userData) {
getCurrentTransaction().commitFile(path);
}
public void addFile(String folderPath, String name, Object parameters, Map userData) throws VcsException {
public void addFile(String folderPath, String name, Object parameters, Map userData) {
KeywordSubstitution substitution = null;
if (parameters instanceof KeywordSubstitution) {
substitution = (KeywordSubstitution)parameters;
@@ -45,7 +45,7 @@ public class CvsStandardOperationsProvider {
getCurrentTransaction().addFile(folderPath, name, substitution);
}
public void removeFile(String path, Object parameters, Map userData) throws VcsException {
public void removeFile(String path, Object parameters, Map userData) {
getCurrentTransaction().removeFile(path);
}
@@ -53,7 +53,7 @@ public class CvsStandardOperationsProvider {
addFile(parentPath, name, parameters, userData);
}
public void removeDirectory(String path, Object parameters, Map userData) throws VcsException {
public void removeDirectory(String path, Object parameters, Map userData) {
}
private RepositoryModificationOperation getCurrentTransaction() {

View File

@@ -162,7 +162,7 @@ public class CvsVcs2 extends AbstractVcs<CvsChangeList> implements TransactionPr
return this;
}
public void startTransaction(Object parameters) throws VcsException {
public void startTransaction(Object parameters) {
myCvsStandardOperationsProvider.createTransaction();
}

View File

@@ -211,7 +211,7 @@ public class CvsAnnotationProvider implements AnnotationProvider{
return getContent();
}
public byte[] getContent() throws IOException, VcsException {
public byte[] getContent() {
return ArrayUtil.EMPTY_BYTE_ARRAY;
}
}

View File

@@ -85,7 +85,7 @@ public class CvsFileOperationsHandler implements LocalFileOperationsHandler {
}
@Nullable
public File copy(final VirtualFile file, final VirtualFile toDir, final String copyName) throws IOException {
public File copy(final VirtualFile file, final VirtualFile toDir, final String copyName) {
return null;
}
@@ -110,7 +110,7 @@ public class CvsFileOperationsHandler implements LocalFileOperationsHandler {
return true;
}
private static void copyDirectoryStructure(final VirtualFile file, final File newFile) throws IOException {
private static void copyDirectoryStructure(final VirtualFile file, final File newFile) {
for(VirtualFile child: file.getChildren()) {
final File newChild = new File(newFile, child.getName());
if (child.isDirectory()) {
@@ -124,11 +124,11 @@ public class CvsFileOperationsHandler implements LocalFileOperationsHandler {
}
}
public boolean createFile(final VirtualFile dir, final String name) throws IOException {
public boolean createFile(final VirtualFile dir, final String name) {
return false;
}
public boolean createDirectory(final VirtualFile dir, final String name) throws IOException {
public boolean createDirectory(final VirtualFile dir, final String name) {
return false;
}

View File

@@ -61,7 +61,7 @@ public class CvsRepositoryLocation implements RepositoryLocation {
}
@Override
public void onBeforeBatch() throws VcsException {
public void onBeforeBatch() {
}
@Override

View File

@@ -35,11 +35,11 @@ import com.intellij.cvsSupport2.config.CvsApplicationLevelConfiguration;
*/
public class CheckoutAdminReader implements IAdminReader{
private final IAdminReader myStandardAdminReader = new AdminReader(CvsApplicationLevelConfiguration.getCharset());
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) {
return null;
}
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) {
return new ArrayList();
}

View File

@@ -24,5 +24,5 @@ import org.jetbrains.annotations.Nullable;
*/
public interface TagsProvider {
@Nullable
CvsCommandOperation getOperation() throws VcsException;
CvsCommandOperation getOperation();
}

View File

@@ -27,7 +27,7 @@ public abstract class TagsProviderOnEnvironment implements TagsProvider {
@Override
@Nullable
public CvsCommandOperation getOperation() throws VcsException {
public CvsCommandOperation getOperation() {
final CvsEnvironment env = getCvsEnvironment();
if (env == null) return null;
return new GetAllBranchesOperation(env, getModule());

View File

@@ -36,7 +36,7 @@ public class AdminReaderForLightFiles implements IAdminReader{
myFileToEntryMap = fileToEntryMap;
}
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) {
String path = directoryObject.getPath();
if (StringUtil.startsWithChar(path, '/')) path = path.substring(1);
return collectEntriesForPath(new File(path));
@@ -59,7 +59,7 @@ public class AdminReaderForLightFiles implements IAdminReader{
return false;
}
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) {
String path = fileObject.getPath();
if (StringUtil.startsWithChar(path, '/')) path = path.substring(1);
return getEntryForPath(new File(path));
@@ -73,7 +73,7 @@ public class AdminReaderForLightFiles implements IAdminReader{
return null;
}
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem) throws IOException {
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem) {
String path = directoryObject.getPath();
if (StringUtil.startsWithChar(path, '/')) path = path.substring(1);
return repository + path.replace(File.separatorChar, '/');

View File

@@ -46,7 +46,7 @@ public class AdminReaderOnCache implements IAdminReader {
private final IAdminReader ourStandardAdminReader = new AdminReader(CvsApplicationLevelConfiguration.getCharset());
private final CvsEntriesManager myCvsEntriesManager = CvsEntriesManager.getInstance();
public Entry getEntry(final AbstractFileObject fileObject, final ICvsFileSystem cvsFileSystem) throws IOException {
public Entry getEntry(final AbstractFileObject fileObject, final ICvsFileSystem cvsFileSystem) {
ProgressManager.checkCanceled();
setProgressText(CvsBundle.message("progress.text.scanning.directory", cvsFileSystem.getLocalFileSystem().getFile(fileObject.getParent()).getAbsolutePath()));
File file = cvsFileSystem.getAdminFileSystem().getFile(fileObject);
@@ -65,7 +65,7 @@ public class AdminReaderOnCache implements IAdminReader {
}
}
public Collection<Entry> getEntries(final DirectoryObject directoryObject, final ICvsFileSystem cvsFileSystem) throws IOException {
public Collection<Entry> getEntries(final DirectoryObject directoryObject, final ICvsFileSystem cvsFileSystem) {
setProgressText(CvsBundle.message("progress.text.scanning.directory", cvsFileSystem.getLocalFileSystem().getFile(directoryObject).getAbsolutePath()));
ProgressManager.checkCanceled();
File parent = cvsFileSystem.getAdminFileSystem().getFile(directoryObject);
@@ -88,7 +88,7 @@ public class AdminReaderOnCache implements IAdminReader {
progressIndicator.setText2(text);
}
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem) throws IOException {
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem) {
File parent = cvsFileSystem.getAdminFileSystem().getFile(directoryObject);
VirtualFile virtualFile = CvsVfsUtil.findFileByIoFile(parent);
String repositoryDerectory = myCvsEntriesManager.getRepositoryFor(virtualFile);

View File

@@ -39,11 +39,11 @@ public class AdminReaderOnStoredRepositoryPath implements IAdminReader {
myRepositoryPathProvider = adminWriter;
}
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) {
return new ArrayList();
}
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) {
return null;
}
@@ -55,8 +55,7 @@ public class AdminReaderOnStoredRepositoryPath implements IAdminReader {
return false;
}
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem)
throws IOException {
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem) {
return myRepositoryPathProvider.getRepositoryPath(repository);
}

View File

@@ -49,35 +49,35 @@ public class AdminWriterStoringRepositoryPath implements IAdminWriter, Repositor
CvsUtil.skip(inputStream, fileLength);
}
public void editFile(FileObject fileObject, Entry entry, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) throws IOException {
public void editFile(FileObject fileObject, Entry entry, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) {
}
public void setStickyTagForDirectory(DirectoryObject directoryObject, String tag, ICvsFileSystem cvsFileSystem) throws IOException {
public void setStickyTagForDirectory(DirectoryObject directoryObject, String tag, ICvsFileSystem cvsFileSystem) {
}
public void removeEntryForFile(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) throws IOException {
public void removeEntryForFile(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) {
}
public void setEntry(DirectoryObject directoryObject, Entry entry, ICvsFileSystem cvsFileSystem) throws IOException {
public void setEntry(DirectoryObject directoryObject, Entry entry, ICvsFileSystem cvsFileSystem) {
}
public void ensureCvsDirectory(DirectoryObject directoryObject, String repositoryPath, CvsRoot cvsRoot, ICvsFileSystem cvsFileSystem) throws IOException {
public void ensureCvsDirectory(DirectoryObject directoryObject, String repositoryPath, CvsRoot cvsRoot, ICvsFileSystem cvsFileSystem) {
if (myRepositoryPath == null) {
myRepositoryPath = repositoryPath;
myModulePath = cvsFileSystem.getRelativeRepositoryPath(repositoryPath);
}
}
public void setEntriesDotStatic(DirectoryObject directoryObject, boolean set, ICvsFileSystem cvsFileSystem) throws IOException {
public void setEntriesDotStatic(DirectoryObject directoryObject, boolean set, ICvsFileSystem cvsFileSystem) {
}
public void uneditFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) throws IOException {
public void uneditFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) {
}
public void pruneDirectory(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) {
}
public void directoryAdded(DirectoryObject directory, ICvsFileSystem cvsFileSystem) throws IOException {
public void directoryAdded(DirectoryObject directory, ICvsFileSystem cvsFileSystem) {
}
public String getRepositoryPath(String repository) {

View File

@@ -37,10 +37,10 @@ public class ConstantLocalFileReader implements ILocalFileReader{
return myFileExists;
}
public void transmitBinaryFile(FileObject fileObject, IConnectionStreams connectionStreams, ICvsFileSystem cvsFileSystem) throws IOException {
public void transmitBinaryFile(FileObject fileObject, IConnectionStreams connectionStreams, ICvsFileSystem cvsFileSystem) {
}
public void transmitTextFile(FileObject fileObject, IConnectionStreams connectionStreams, ICvsFileSystem cvsFileSystem) throws IOException {
public void transmitTextFile(FileObject fileObject, IConnectionStreams connectionStreams, ICvsFileSystem cvsFileSystem) {
}
public void listFilesAndDirectories(DirectoryObject directoryObject, Collection<String> fileNames, Collection<String> directoryNames, ICvsFileSystem cvsFileSystem) {

View File

@@ -37,7 +37,7 @@ public class DeafAdminReader implements IAdminReader{
return false;
}
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Entry getEntry(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) {
return null;
}
@@ -45,11 +45,11 @@ public class DeafAdminReader implements IAdminReader{
return false;
}
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) throws IOException {
public Collection getEntries(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) {
return null;
}
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem) throws IOException {
public String getRepositoryForDirectory(DirectoryObject directoryObject, String repository, ICvsFileSystem cvsFileSystem) {
return repository + directoryObject.getPath();
}

View File

@@ -29,15 +29,15 @@ import java.io.InputStream;
* author: lesya
*/
public class DeafAdminWriter implements IAdminWriter{
public void ensureCvsDirectory(DirectoryObject directoryObject, String repositoryPath, CvsRoot cvsRoot, ICvsFileSystem cvsFileSystem) throws IOException {
public void ensureCvsDirectory(DirectoryObject directoryObject, String repositoryPath, CvsRoot cvsRoot, ICvsFileSystem cvsFileSystem) {
}
public void setEntry(DirectoryObject directoryObject, Entry entry, ICvsFileSystem cvsFileSystem) throws IOException {
public void setEntry(DirectoryObject directoryObject, Entry entry, ICvsFileSystem cvsFileSystem) {
}
public void removeEntryForFile(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) throws IOException {
public void removeEntryForFile(AbstractFileObject fileObject, ICvsFileSystem cvsFileSystem) {
}
@@ -45,19 +45,19 @@ public class DeafAdminWriter implements IAdminWriter{
}
public void editFile(FileObject fileObject, Entry entry, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) throws IOException {
public void editFile(FileObject fileObject, Entry entry, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) {
}
public void uneditFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) throws IOException {
public void uneditFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) {
}
public void setStickyTagForDirectory(DirectoryObject directoryObject, String tag, ICvsFileSystem cvsFileSystem) throws IOException {
public void setStickyTagForDirectory(DirectoryObject directoryObject, String tag, ICvsFileSystem cvsFileSystem) {
}
public void setEntriesDotStatic(DirectoryObject directoryObject, boolean set, ICvsFileSystem cvsFileSystem) throws IOException {
public void setEntriesDotStatic(DirectoryObject directoryObject, boolean set, ICvsFileSystem cvsFileSystem) {
}
@@ -65,7 +65,7 @@ public class DeafAdminWriter implements IAdminWriter{
CvsUtil.skip(inputStream, fileLength);
}
public void directoryAdded(DirectoryObject directory, ICvsFileSystem cvsFileSystem) throws IOException {
public void directoryAdded(DirectoryObject directory, ICvsFileSystem cvsFileSystem) {
}
}

View File

@@ -49,7 +49,7 @@ public class ComparableVcsRevisionOnOperation implements VcsFileRevision {
return myOperation.isDeleted();
}
public byte[] getContent() throws IOException, VcsException {
public byte[] getContent() {
LOG.assertTrue(myOperation.isLoaded());
return myOperation.getFileBytes();
}

View File

@@ -201,7 +201,7 @@ public class CvsHistoryProvider implements VcsHistoryProvider {
}
}
public void reportAppendableHistory(FilePath path, VcsAppendableHistorySessionPartner partner) throws VcsException {
public void reportAppendableHistory(FilePath path, VcsAppendableHistorySessionPartner partner) {
final VcsHistorySession session;
if (path instanceof CvsFilePath) {
final CvsRepositoryLocation location = ((CvsFilePath)path).getRepositoryLocation();

View File

@@ -44,14 +44,13 @@ public class DeafLocalFileWriter implements ILocalFileWriter{
CvsUtil.skip(inputStream, length);
}
public void renameLocalFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, String newFileName)
throws IOException {
public void renameLocalFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, String newFileName) {
}
public void removeLocalFile(FileObject fileObject,
ICvsFileSystem cvsFileSystem,
IFileReadOnlyHandler fileReadOnlyHandler) throws IOException {
IFileReadOnlyHandler fileReadOnlyHandler) {
}
public void writeTextFile(FileObject fileObject,

View File

@@ -270,7 +270,7 @@ public final class RequestProcessor implements IRequestProcessor {
}
@Override
protected void after() throws CommandException {
protected void after() {
}
}

View File

@@ -12,10 +12,14 @@
*/
package org.netbeans.lib.cvsclient.command.importcmd;
import org.jetbrains.annotations.NonNls;
import org.netbeans.lib.cvsclient.IClientEnvironment;
import org.netbeans.lib.cvsclient.IRequestProcessor;
import org.netbeans.lib.cvsclient.command.Command;
import org.netbeans.lib.cvsclient.command.CommandException;
import org.netbeans.lib.cvsclient.command.CommandUtils;
import org.netbeans.lib.cvsclient.command.KeywordSubstitution;
import org.netbeans.lib.cvsclient.connection.AuthenticationException;
import org.netbeans.lib.cvsclient.command.*;
import org.netbeans.lib.cvsclient.event.ICvsListenerRegistry;
import org.netbeans.lib.cvsclient.event.IEventSender;
import org.netbeans.lib.cvsclient.file.DirectoryObject;
@@ -27,11 +31,12 @@ import org.netbeans.lib.cvsclient.request.DirectoryRequest;
import org.netbeans.lib.cvsclient.request.Requests;
import org.netbeans.lib.cvsclient.util.BugLog;
import org.netbeans.lib.cvsclient.util.SimpleStringPattern;
import org.jetbrains.annotations.NonNls;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* The import command imports local directory structures into the repository.
@@ -64,29 +69,24 @@ public final class ImportCommand extends Command {
BugLog.getInstance().assertNotNull(getVendorTag());
final Requests requests;
try {
requests = new Requests(CommandRequest.IMPORT, clientEnvironment);
requests.addArgumentRequest(getVendorBranchNotNull(), "-b");
requests.addMessageRequests(CommandUtils.getMessageNotNull(getLogMessage()));
requests.addArgumentRequest(getKeywordSubstitutionOption(), "-k");
requests = new Requests(CommandRequest.IMPORT, clientEnvironment);
requests.addArgumentRequest(getVendorBranchNotNull(), "-b");
requests.addMessageRequests(CommandUtils.getMessageNotNull(getLogMessage()));
requests.addArgumentRequest(getKeywordSubstitutionOption(), "-k");
addWrapperRequests(requests, this.wrapperMap);
addWrapperRequests(requests, this.wrapperMap);
requests.addArgumentRequest(getModule());
requests.addArgumentRequest(getVendorTag());
requests.addArgumentRequest(getReleaseTag());
requests.addArgumentRequest(getModule());
requests.addArgumentRequest(getVendorTag());
requests.addArgumentRequest(getReleaseTag());
final File rootDirectory = clientEnvironment.getCvsFileSystem().getLocalFileSystem().getRootDirectory();
addFileRequests(rootDirectory, requests, requestProcessor, clientEnvironment);
final File rootDirectory = clientEnvironment.getCvsFileSystem().getLocalFileSystem().getRootDirectory();
addFileRequests(rootDirectory, requests, requestProcessor, clientEnvironment);
// This is necessary when importing a directory structure with CVS directories.
// If requests.addLocalPathDirectoryRequest(); would be used, the repository path
// would be used from the CVS folders.
requests.addRequest(new DirectoryRequest(".", getRepositoryRoot(clientEnvironment)));
}
catch (IOException ex) {
throw new IOCommandException(ex);
}
// This is necessary when importing a directory structure with CVS directories.
// If requests.addLocalPathDirectoryRequest(); would be used, the repository path
// would be used from the CVS folders.
requests.addRequest(new DirectoryRequest(".", getRepositoryRoot(clientEnvironment)));
return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
}
@@ -247,7 +247,7 @@ public final class ImportCommand extends Command {
* Adds recursively all request for files and directories in the specified
* directory to the specified requestList.
*/
private void addFileRequests(File directory, Requests requests, IRequestProcessor requestProcessor, IClientEnvironment clientEnvironment) throws IOException {
private void addFileRequests(File directory, Requests requests, IRequestProcessor requestProcessor, IClientEnvironment clientEnvironment) {
final DirectoryObject directoryObject = clientEnvironment.getCvsFileSystem().getLocalFileSystem().getDirectoryObject(directory);
final String relativePath = directoryObject.toUnixPath();

View File

@@ -25,7 +25,7 @@ public abstract class AbstractInputStreamReader extends Reader {
// Abstract ===============================================================
protected abstract int readChar(InputStream inputStream) throws IOException;
protected abstract int readChar(InputStream inputStream);
// Fields =================================================================

View File

@@ -132,7 +132,7 @@ public final class AdminWriter implements IAdminWriter {
fileReadOnlyHandler.setFileReadOnly(cvsFileSystem.getLocalFileSystem().getFile(fileObject), true);
}
public void setEntriesDotStatic(DirectoryObject directoryObject, boolean set, ICvsFileSystem cvsFileSystem) throws IOException {
public void setEntriesDotStatic(DirectoryObject directoryObject, boolean set, ICvsFileSystem cvsFileSystem) {
final File localDirectory = cvsFileSystem.getAdminFileSystem().getFile(directoryObject);
if (set) {
final File cvsDirectory = getCvsDirectoryForLocalDirectory(localDirectory);

View File

@@ -15,7 +15,7 @@ public final class DummyAdminWriter
// Implemented ============================================================
public void ensureCvsDirectory(DirectoryObject directoryObject, String repositoryPath, CvsRoot cvsRoot, ICvsFileSystem cvsFileSystem) throws IOException {
public void ensureCvsDirectory(DirectoryObject directoryObject, String repositoryPath, CvsRoot cvsRoot, ICvsFileSystem cvsFileSystem) {
}
public void setEntry(DirectoryObject directoryObject, Entry entry, ICvsFileSystem cvsFileSystem) {
@@ -39,9 +39,9 @@ public final class DummyAdminWriter
public void setEntriesDotStatic(DirectoryObject directoryObject, boolean set, ICvsFileSystem cvsFileSystem) {
}
public void writeTemplateFile(DirectoryObject directoryObject, int fileLength, InputStream inputStream, IReaderFactory readerFactory, IClientEnvironment clientEnvironment) throws IOException {
public void writeTemplateFile(DirectoryObject directoryObject, int fileLength, InputStream inputStream, IReaderFactory readerFactory, IClientEnvironment clientEnvironment) {
}
public void directoryAdded(DirectoryObject directory, ICvsFileSystem cvsFileSystem) throws IOException {
public void directoryAdded(DirectoryObject directory, ICvsFileSystem cvsFileSystem) {
}
}

View File

@@ -14,16 +14,16 @@ public final class DummyLocalFileWriter
// Implemented ============================================================
public void writeTextFile(FileObject fileObject, int length, InputStream inputStream, boolean readOnly, IReaderFactory readerFactory,
IFileReadOnlyHandler fileReadOnlyHandler, IFileSystem fileSystem, final Charset charSet) throws IOException {
IFileReadOnlyHandler fileReadOnlyHandler, IFileSystem fileSystem, final Charset charSet) {
}
public void writeBinaryFile(FileObject fileObject, int length, InputStream inputStream, boolean readOnly, IFileReadOnlyHandler fileReadOnlyHandler, ICvsFileSystem cvsFileSystem) throws IOException {
public void writeBinaryFile(FileObject fileObject, int length, InputStream inputStream, boolean readOnly, IFileReadOnlyHandler fileReadOnlyHandler, ICvsFileSystem cvsFileSystem) {
}
public void removeLocalFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) throws IOException {
public void removeLocalFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, IFileReadOnlyHandler fileReadOnlyHandler) {
}
public void renameLocalFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, String newFileName) throws IOException {
public void renameLocalFile(FileObject fileObject, ICvsFileSystem cvsFileSystem, String newFileName) {
}
public void setNextFileDate(Date modifiedDate) {

View File

@@ -524,7 +524,7 @@ public class SSHMain implements GitExternalApp {
final String instruction,
final int numPrompts,
final String[] prompt,
final boolean[] echo) throws Exception {
final boolean[] echo) {
if (numPrompts == 0) {
return ArrayUtilRt.EMPTY_STRING_ARRAY;
}
@@ -556,7 +556,7 @@ public class SSHMain implements GitExternalApp {
/**
* {@inheritDoc}
*/
public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey) throws Exception {
public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey) {
try {
String s = System.getenv(GitSSHHandler.SSH_IGNORE_KNOWN_HOSTS_ENV);
if (s != null && Boolean.parseBoolean(s)) {

View File

@@ -135,7 +135,7 @@ public class GitFileRevision extends VcsFileRevisionEx implements Comparable<Vcs
return myBranch;
}
public synchronized byte[] loadContent() throws IOException, VcsException {
public synchronized byte[] loadContent() throws VcsException {
VirtualFile root = getRoot();
return GitFileUtils.getFileContent(myProject, root, myRevision.getRev(), VcsFileUtil.relativePath(root, myPath));
}
@@ -144,7 +144,7 @@ public class GitFileRevision extends VcsFileRevisionEx implements Comparable<Vcs
return myRoot != null ? myRoot : GitUtil.getGitRoot(myPath);
}
public synchronized byte[] getContent() throws IOException, VcsException {
public synchronized byte[] getContent() throws VcsException {
return loadContent();
}

View File

@@ -278,11 +278,11 @@ public class GitVcs extends AbstractVcs<CommittedChangeList> {
}
@Override
protected void start() throws VcsException {
protected void start() {
}
@Override
protected void shutdown() throws VcsException {
protected void shutdown() {
}
@Override

View File

@@ -17,7 +17,6 @@
package git4idea.changes;
import com.intellij.openapi.vcs.RepositoryLocation;
import com.intellij.openapi.vcs.VcsException;
import java.io.File;
@@ -44,7 +43,7 @@ public class GitRepositoryLocation implements RepositoryLocation {
}
@Override
public void onBeforeBatch() throws VcsException {
public void onBeforeBatch() {
}
@Override

View File

@@ -16,7 +16,6 @@
package git4idea.config;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
import git4idea.GitVcs;
import org.jetbrains.annotations.NotNull;
@@ -65,7 +64,7 @@ public class GitVcsConfigurable implements Configurable {
}
@Override
public void apply() throws ConfigurationException {
public void apply() {
panel.save(mySettings, mySharedSettings);
}

View File

@@ -168,14 +168,14 @@ public class GitHistoryProvider implements VcsHistoryProviderEx,
return ! processor.process(content.getContent());
}
public void reportAppendableHistory(FilePath path, VcsAppendableHistorySessionPartner partner) throws VcsException {
public void reportAppendableHistory(FilePath path, VcsAppendableHistorySessionPartner partner) {
reportAppendableHistory(path, null, partner);
}
@Override
public void reportAppendableHistory(@NotNull FilePath path,
@Nullable VcsRevisionNumber startingRevision,
@NotNull final VcsAppendableHistorySessionPartner partner) throws VcsException {
@NotNull final VcsAppendableHistorySessionPartner partner) {
final VcsAbstractHistorySession emptySession = createSession(path, Collections.emptyList(), null);
partner.reportCreatedEmptySession(emptySession);

View File

@@ -514,7 +514,7 @@ public class GitLogProvider implements VcsLogProvider {
@Nullable
@Override
public VcsUser getCurrentUser(@NotNull VirtualFile root) throws VcsException {
public VcsUser getCurrentUser(@NotNull VirtualFile root) {
return myUserRegistry.getOrReadUser(root);
}

View File

@@ -499,7 +499,7 @@ public class GitRebaseProcess {
@CalledInBackground
@Override
protected boolean proceedAfterAllMerged() throws VcsException {
protected boolean proceedAfterAllMerged() {
if (myCalledFromNotification) {
retry(GitRebaseUtils.CONTINUE_PROGRESS_TITLE);
}
@@ -507,7 +507,7 @@ public class GitRebaseProcess {
}
@Override
protected boolean proceedIfNothingToMerge() throws VcsException {
protected boolean proceedIfNothingToMerge() {
myWasNothingToMerge = true;
return true;
}

View File

@@ -188,7 +188,7 @@ public class GitRebaser {
* NB: If there are merges in the unpushed commits being reordered, a conflict would happen. The calling code should probably
* prohibit reordering merge commits.
*/
public boolean reoderCommitsIfNeeded(@NotNull final VirtualFile root, @NotNull String parentCommit, @NotNull List<String> olderCommits) throws VcsException {
public boolean reoderCommitsIfNeeded(@NotNull final VirtualFile root, @NotNull String parentCommit, @NotNull List<String> olderCommits) {
List<String> allCommits = new ArrayList<>(); //TODO
if (olderCommits.isEmpty() || olderCommits.size() == allCommits.size()) {
LOG.info("Nothing to reorder. olderCommits: " + olderCommits + " allCommits: " + allCommits);
@@ -369,11 +369,11 @@ public class GitRebaser {
return params;
}
@Override protected boolean proceedIfNothingToMerge() throws VcsException {
@Override protected boolean proceedIfNothingToMerge() {
return myRebaser.continueRebase(myRoot);
}
@Override protected boolean proceedAfterAllMerged() throws VcsException {
@Override protected boolean proceedAfterAllMerged() {
return myRebaser.continueRebase(myRoot);
}
}

View File

@@ -16,7 +16,6 @@
package git4idea.update;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import git4idea.config.GitVcsSettings;
import git4idea.i18n.GitBundle;
import org.jetbrains.annotations.Nls;
@@ -73,7 +72,7 @@ public class GitUpdateConfigurable implements Configurable {
/**
* {@inheritDoc}
*/
public void apply() throws ConfigurationException {
public void apply() {
myPanel.applyTo(mySettings);
}

View File

@@ -223,7 +223,7 @@ public class GitVFSListener extends VcsVFSListener {
Set<File> toRefresh = newHashSet();
performBackgroundOperation(filesToMove.keySet(), "Moving Files...", new LongOperationPerRootExecutor() {
@Override
public void execute(@NotNull VirtualFile root, @NotNull List<FilePath> files) throws VcsException {
public void execute(@NotNull VirtualFile root, @NotNull List<FilePath> files) {
for (FilePath file : files) {
GitHandler h = new GitSimpleHandler(myProject, root, GitCommand.MV);
MovedFileInfo info = filesToMove.get(file);

View File

@@ -111,7 +111,7 @@ public class GitLogProviderTest extends GitSingleRepoTest {
assertOrderedEquals(expectedLog, collector);
}
public void test_get_current_user() throws Exception {
public void test_get_current_user() {
VcsUser user = myLogProvider.getCurrentUser(myProjectRoot);
assertNotNull("User is not defined", user);
VcsUser expected = getDefaultUser();

View File

@@ -52,37 +52,37 @@ public class GitRebaserReorderCommitsTest extends GitSingleRepoTest {
return false;
}
public void testReorderingNothingShouldDoNothing() throws Exception {
public void testReorderingNothingShouldDoNothing() {
myRebaser.reoderCommitsIfNeeded(myProjectRoot, myFirstCommit, Collections.emptyList());
assertCommits(myFirstCommit);
}
public void testReorderingOneShouldDoNothing() throws Exception {
public void testReorderingOneShouldDoNothing() {
String hash = makeCommit();
myRebaser.reoderCommitsIfNeeded(myProjectRoot, myFirstCommit, Collections.singletonList(hash));
assertCommits(myFirstCommit, hash);
}
public void testReorderingAllShouldDoNothing() throws Exception {
public void testReorderingAllShouldDoNothing() {
String hash1 = makeCommit();
String hash2 = makeCommit();
myRebaser.reoderCommitsIfNeeded(myProjectRoot, myFirstCommit, Arrays.asList(hash1, hash2));
assertCommits(myFirstCommit, hash1, hash2);
}
public void disabled_testReorderingOldestShouldDoNothing() throws Exception {
public void disabled_testReorderingOldestShouldDoNothing() {
String[] hashes = makeCommits(3);
myRebaser.reoderCommitsIfNeeded(myProjectRoot, myFirstCommit, Arrays.asList(hashes[0], hashes[1]));
assertCommits(myFirstCommit, hashes[0], hashes[1], hashes[2]);
}
public void disabled_testReorderingOneCommit() throws Exception {
public void disabled_testReorderingOneCommit() {
String[] hashes = makeCommits(3);
myRebaser.reoderCommitsIfNeeded(myProjectRoot, myFirstCommit, Collections.singletonList(hashes[2]));
assertCommits(myFirstCommit, hashes[2], hashes[0], hashes[1]);
}
public void disabled_testReorderingTwoCommits() throws Exception {
public void disabled_testReorderingTwoCommits() {
String[] hashes = makeCommits(3);
myRebaser.reoderCommitsIfNeeded(myProjectRoot, myFirstCommit, Arrays.asList(hashes[2], hashes[1]));
assertCommits(myFirstCommit, hashes[2], hashes[1], hashes[0]);

View File

@@ -230,7 +230,7 @@ public class GithubCreatePullRequestWorker {
}
}
private void doLoadForksFromSettings(@NotNull ProgressIndicator indicator) throws IOException {
private void doLoadForksFromSettings(@NotNull ProgressIndicator indicator) {
GithubFullPath savedRepo = GithubProjectSettings.getInstance(myProject).getCreatePullRequestDefaultRepo();
if (savedRepo != null) {
doAddFork(savedRepo, null, indicator);

View File

@@ -145,7 +145,7 @@ class GithubConnectionBuilder {
}
@Override
public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
public void process(HttpRequest request, HttpContext context) throws HttpException {
CredentialsProvider provider = (CredentialsProvider)context.getAttribute(HttpClientContext.CREDS_PROVIDER);
Credentials credentials = provider.getCredentials(myBasicAuthScope);
if (credentials != null) {

View File

@@ -56,7 +56,7 @@ public class GithubSettingsConfigurable implements SearchableConfigurable, VcsCo
return mySettingsPane != null && mySettingsPane.isModified();
}
public void apply() throws ConfigurationException {
public void apply() {
if (mySettingsPane != null) {
mySettingsPane.apply();
}

View File

@@ -31,7 +31,7 @@ public class HgBinaryContentRevision extends HgContentRevision implements Binary
@Nullable
@Override
public byte[] getBinaryContent() throws VcsException {
public byte[] getBinaryContent() {
return getContentAsBytes();
}
}

View File

@@ -47,7 +47,7 @@ public class HgContentRevision implements ByteBackedContentRevision {
@Nullable
@Override
public String getContent() throws VcsException {
public String getContent() {
if (myRevisionNumber.isWorkingVersion()) return VcsUtil.getFileContent(myHgFile.getFile().getPath());
final HgFile fileToCat = HgUtil.getFileNameInTargetRevision(myProject, myRevisionNumber, myHgFile);
return CharsetToolkit.bytesToString(HgUtil.loadContent(myProject, myRevisionNumber, fileToCat), getFile().getCharset());

View File

@@ -106,7 +106,7 @@ public class HgFileRevision implements VcsFileRevision {
}
@NotNull
public byte[] loadContent() throws IOException, VcsException {
public byte[] loadContent() {
final HgFile fileToCat = HgUtil.getFileNameInTargetRevision(myProject, myRevisionNumber, myFile);
return HgUtil.loadContent(myProject, myRevisionNumber, fileToCat);
}

View File

@@ -100,16 +100,11 @@ public class HgVFSListener extends VcsVFSListener {
VirtualFile repo = e.getKey();
final Collection<VirtualFile> files = e.getValue();
pi.setText(repo.getPresentableUrl());
try {
Collection<VirtualFile> untrackedForRepo = new HgStatusCommand.Builder(false).unknown(true).removed(true).build(myProject)
.getFiles(repo, new ArrayList<>(files));
untrackedFiles.addAll(untrackedForRepo);
List<VirtualFile> ignoredForRepo = files.stream().filter(file -> !untrackedForRepo.contains(file)).collect(Collectors.toList());
getIgnoreRepoHolder(repo).addFiles(ignoredForRepo);
}
catch (final VcsException ex) {
UIUtil.invokeLaterIfNeeded(() -> ((HgVcs)myVcs).showMessageInConsole(ex.getMessage(), ConsoleViewContentType.ERROR_OUTPUT));
}
Collection<VirtualFile> untrackedForRepo = new HgStatusCommand.Builder(false).unknown(true).removed(true).build(myProject)
.getFiles(repo, new ArrayList<>(files));
untrackedFiles.addAll(untrackedForRepo);
List<VirtualFile> ignoredForRepo = files.stream().filter(file -> !untrackedForRepo.contains(file)).collect(Collectors.toList());
getIgnoreRepoHolder(repo).addFiles(ignoredForRepo);
}
addedFiles.retainAll(untrackedFiles);
// select files to add if there is something to select
@@ -316,7 +311,7 @@ public class HgVFSListener extends VcsVFSListener {
HgVcsMessages.message("hg4idea.move.progress"),
VcsConfiguration.getInstance(myProject).getAddRemoveOption(),
movedFiles) {
protected void process(final MovedFileInfo file) throws VcsException {
protected void process(final MovedFileInfo file) {
final FilePath source = VcsUtil.getFilePath(file.myOldPath);
final FilePath target = VcsUtil.getFilePath(file.myNewPath);
VirtualFile sourceRoot = VcsUtil.getVcsRootFor(myProject, source);

View File

@@ -35,7 +35,7 @@ abstract class HgAbstractFilesAction extends AnAction {
protected abstract boolean isEnabled(Project project, HgVcs vcs, VirtualFile file);
protected abstract void batchPerform(Project project, final HgVcs activeVcs,
List<VirtualFile> files, DataContext context) throws VcsException;
List<VirtualFile> files, DataContext context);
public final void actionPerformed(AnActionEvent event) {
final DataContext dataContext = event.getDataContext();

View File

@@ -32,7 +32,7 @@ public class HgMarkResolved extends HgAbstractFilesAction {
}
protected void batchPerform(Project project, HgVcs activeVcs,
List<VirtualFile> files, DataContext context) throws VcsException {
List<VirtualFile> files, DataContext context) {
HgResolveCommand resolveCommand = new HgResolveCommand(project);
for (VirtualFile file : files) {
VirtualFile root = VcsUtil.getVcsRootFor(project, file);

View File

@@ -55,7 +55,7 @@ public class HgCommitCommand extends HgCommitTypeCommand {
this(project, repo, message, false);
}
protected void executeChunked(@NotNull List<List<String>> chunkedCommits) throws HgCommandException, VcsException {
protected void executeChunked(@NotNull List<List<String>> chunkedCommits) throws VcsException {
if (chunkedCommits.isEmpty()) {
commitChunkFiles(ContainerUtil.emptyList(), myAmend, myCloseBranch);
}

View File

@@ -91,5 +91,5 @@ public abstract class HgCommitTypeCommand {
BackgroundTaskUtil.syncPublisher(myProject, HgVcs.REMOTE_TOPIC).update(myProject, null);
}
protected abstract void executeChunked(@NotNull List<List<String>> chunkedCommits) throws HgCommandException, VcsException;
protected abstract void executeChunked(@NotNull List<List<String>> chunkedCommits) throws VcsException;
}

View File

@@ -71,7 +71,7 @@ public class HgLogCommand {
/**
* @param limit Pass -1 to set no limits on history
*/
public final List<HgFileRevision> execute(final HgFile hgFile, int limit, boolean includeFiles) throws HgCommandException {
public final List<HgFileRevision> execute(final HgFile hgFile, int limit, boolean includeFiles) {
return execute(hgFile, limit, includeFiles, null);
}

View File

@@ -14,7 +14,6 @@ package org.zmlx.hg4idea.command;
import com.intellij.dvcs.DvcsUtil;
import com.intellij.openapi.application.AccessToken;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;
@@ -32,7 +31,6 @@ import org.zmlx.hg4idea.repo.HgRepository;
import org.zmlx.hg4idea.util.HgErrorUtil;
import org.zmlx.hg4idea.util.HgUtil;
import java.lang.reflect.InvocationTargetException;
import java.util.LinkedList;
import java.util.List;
@@ -40,8 +38,6 @@ import static org.zmlx.hg4idea.HgErrorHandler.ensureSuccess;
public class HgMergeCommand {
private static final Logger LOG = Logger.getInstance(HgMergeCommand.class.getName());
@NotNull private final Project project;
@NotNull private final HgRepository repo;
@Nullable private String revision;
@@ -78,13 +74,7 @@ public class HgMergeCommand {
@Nullable
public HgCommandResult mergeSynchronously() throws VcsException {
HgCommandResult commandResult = ensureSuccess(executeInCurrentThread());
try {
HgUtil.markDirectoryDirty(project, repo.getRoot());
}
catch (InvocationTargetException | InterruptedException e) {
throwException(e);
}
HgUtil.markDirectoryDirty(project, repo.getRoot());
return commandResult;
}
@@ -129,10 +119,4 @@ public class HgMergeCommand {
}
}.queue();
}
private static void throwException(@NotNull Exception e) throws VcsException {
String msg = "Exception during marking directory dirty: " + e;
LOG.info(msg, e);
throw new VcsException(msg);
}
}

Some files were not shown because too many files have changed in this diff Show More