From eb16673113d45e997e808a94d148b29a12d03e0c Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Mon, 28 May 2018 17:31:41 +0300 Subject: [PATCH] svn: Refactor "SvnRootsDetector" - remove unnecessary catch --- .../jetbrains/idea/svn/SvnRootsDetector.java | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java index 7f528127f8f7..a58a1db7f831 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnRootsDetector.java @@ -1,7 +1,6 @@ -// 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. +// Copyright 2000-2018 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; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vcs.changes.ChangeListManager; import com.intellij.openapi.vcs.changes.InvokeAfterUpdateMode; @@ -28,8 +27,6 @@ import static org.jetbrains.idea.svn.SvnUtil.isAncestor; */ public class SvnRootsDetector { - private static final Logger LOG = Logger.getInstance(SvnRootsDetector.class); - @NotNull private final SvnVcs myVcs; @NotNull private final SvnFileUrlMappingImpl myMapping; @NotNull private final Result myResult; @@ -148,22 +145,16 @@ public class SvnRootsDetector { // TODO: For example they are not set for externals. Probably this logic could be moved to NestedCopiesBuilder instead. boolean refreshed = false; - // TODO: No checked exceptions are thrown - remove catch/LOG.error/rethrow to fix real cause if any - try { - final File infoFile = virtualToIoFile(info.getFile()); - final Status svnStatus = SvnUtil.getStatus(myVcs, infoFile); + final File infoFile = virtualToIoFile(info.getFile()); + final Status svnStatus = SvnUtil.getStatus(myVcs, infoFile); - if (svnStatus != null && svnStatus.getURL() != null) { - info.setUrl(svnStatus.getURL()); - info.setFormat(myVcs.getWorkingCopyFormat(infoFile, false)); - if (svnStatus.getRepositoryRootURL() != null) { - info.setRootURL(svnStatus.getRepositoryRootURL()); - } - refreshed = true; + if (svnStatus != null && svnStatus.getURL() != null) { + info.setUrl(svnStatus.getURL()); + info.setFormat(myVcs.getWorkingCopyFormat(infoFile, false)); + if (svnStatus.getRepositoryRootURL() != null) { + info.setRootURL(svnStatus.getRepositoryRootURL()); } - } - catch (Exception e) { - LOG.info(e); + refreshed = true; } return refreshed;