diff options
author | Sergey Prigogin | 2016-08-08 05:05:33 +0000 |
---|---|---|
committer | Sergey Prigogin | 2016-08-08 18:09:34 +0000 |
commit | 26cee0d9d66ff140d1a5485380ee3d54f8bd1d81 (patch) | |
tree | 7e97a19fc8986bde848825f63d7e08df1c47c5b3 | |
parent | 89069a81e91d3a6d0efde9c7310f591e8ae338c4 (diff) | |
download | eclipse.platform.team-26cee0d9d66ff140d1a5485380ee3d54f8bd1d81.tar.gz eclipse.platform.team-26cee0d9d66ff140d1a5485380ee3d54f8bd1d81.tar.xz eclipse.platform.team-26cee0d9d66ff140d1a5485380ee3d54f8bd1d81.zip |
Fixed compiler warnings.
Change-Id: Id1f7f83044c137b9db9cdc252a413b4f02a5bbba
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java index f32fb4499..a5343e5e0 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java @@ -88,7 +88,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit // Locks for ensuring that authentication to a host is serialized // so that invalid passwords do not result in account lockout - private static Map<String, ILock> hostLocks = new HashMap<String, ILock>(); + private static Map<String, ILock> hostLocks = new HashMap<>(); private IConnectionMethod method; private String user; @@ -390,13 +390,11 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit if (validateOnly) throw new CVSException(new CVSStatus(IStatus.OK, CVSMessages.ok));// return new CVSRepositoryLocation(method, user, password, host, port, root, null /* encoding */, (user != null), (password != null)); - } - catch (IndexOutOfBoundsException e) { + } catch (IndexOutOfBoundsException e) { // We'll get here if anything funny happened while extracting substrings IStatus status = new CVSStatus(IStatus.ERROR, errorMessage); throw new CVSException(status); - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { IStatus status = new CVSStatus(IStatus.ERROR, errorMessage); // We'll get here if we couldn't parse a number throw new CVSException(status); @@ -442,14 +440,10 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit } } IConnectionMethod[] methods = connectionMethods.toArray(new IConnectionMethod[0]); - Arrays.sort(methods, new Comparator(){ - public int compare(Object o1, Object o2) { - if (o1 instanceof IConnectionMethod && o2 instanceof IConnectionMethod) { - IConnectionMethod cm1 = (IConnectionMethod) o1; - IConnectionMethod cm2 = (IConnectionMethod) o2; - return cm1.getName().compareTo(cm2.getName()); - } - return 0; + Arrays.sort(methods, new Comparator<IConnectionMethod> () { + @Override + public int compare(IConnectionMethod cm1, IConnectionMethod cm2) { + return cm1.getName().compareTo(cm2.getName()); }}); pluggedInConnectionMethods = methods; } |