From 8552665983e19e5c5acf16bced9b3cdae817676b Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Wed, 25 Apr 2018 14:48:24 +0300 Subject: [PATCH] svn: Refactor "ConflictVersion", @NotNull --- .../idea/svn/conflict/ConflictVersion.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictVersion.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictVersion.java index 0446ad526834..0fa4cb97754e 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictVersion.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/conflict/ConflictVersion.java @@ -1,4 +1,4 @@ -// 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.conflict; import org.jetbrains.annotations.NotNull; @@ -9,20 +9,23 @@ import org.jetbrains.idea.svn.api.Url; public class ConflictVersion extends BaseNodeDescription { - private final Url myRepositoryRoot; - private final String myPath; + @NotNull private final Url myRepositoryRoot; + @NotNull private final String myPath; private final long myPegRevision; - public ConflictVersion(Url repositoryRoot, String path, long pegRevision, @NotNull NodeKind kind) { + + public ConflictVersion(@NotNull Url repositoryRoot, @NotNull String path, long pegRevision, @NotNull NodeKind kind) { super(kind); myRepositoryRoot = repositoryRoot; myPath = path; myPegRevision = pegRevision; } + @NotNull public Url getRepositoryRoot() { return myRepositoryRoot; } + @NotNull public String getPath() { return myPath; } @@ -38,13 +41,7 @@ public class ConflictVersion extends BaseNodeDescription { @NotNull public String toPresentableString() { - StringBuilder urlBuilder = new StringBuilder(); - - urlBuilder.append(myRepositoryRoot != null ? myRepositoryRoot : ""); - urlBuilder.append("/"); - urlBuilder.append(myPath != null ? myPath : "..."); - - return "(" + getKind() + ") " + urlBuilder + "@" + getPegRevision(); + return "(" + getKind() + ") " + myRepositoryRoot + "/" + myPath + "@" + getPegRevision(); } @NotNull