patch: inline only field usage

This commit is contained in:
Aleksey Pivovarov
2016-07-15 18:42:54 +03:00
parent 28bb6dee75
commit 3dc021ead3
2 changed files with 2 additions and 8 deletions
@@ -53,7 +53,7 @@ public class PatchReader {
@NonNls private static final Pattern ourUnifiedHunkStartPattern = Pattern.compile("@@ -(\\d+)(,(\\d+))? \\+(\\d+)(,(\\d+))? @@.*");
@NonNls private static final Pattern ourContextBeforeHunkStartPattern = Pattern.compile("\\*\\*\\* (\\d+),(\\d+) \\*\\*\\*\\*");
@NonNls private static final Pattern ourContextAfterHunkStartPattern = Pattern.compile("--- (\\d+),(\\d+) ----");
@NonNls private static final Pattern EMPTY_REVISION_INFO_PATTERN = Pattern.compile(TextPatchBuilder.getEmptyRevisionPattern());
@NonNls private static final Pattern ourEmptyRevisionInfoPattern = Pattern.compile("\\(\\s*revision\\s*\\)");
public PatchReader(CharSequence patchContent) {
this(patchContent, true);
@@ -570,7 +570,7 @@ public class PatchReader {
if (pos >= 0) {
String versionId = fileName.substring(pos).trim();
fileName = fileName.substring(0, pos);
if (versionId.length() > 0 && !EMPTY_REVISION_INFO_PATTERN.matcher(versionId).matches()) {
if (versionId.length() > 0 && !ourEmptyRevisionInfoPattern.matcher(versionId).matches()) {
if (before) {
patch.setBeforeVersionId(versionId);
}
@@ -43,7 +43,6 @@ public class TextPatchBuilder {
private static final int CONTEXT_LINES = 3;
@NonNls private static final String REVISION_NAME_TEMPLATE = "(revision {0})";
@NonNls private static final String DATE_NAME_TEMPLATE = "(date {0})";
@NonNls private static final String EMPTY_REVISION_INFO = "\\(\\s*revision\\s*\\)";
@NotNull private final String myBasePath;
private final boolean myIsReversePath;
@@ -65,11 +64,6 @@ public class TextPatchBuilder {
}
}
@NotNull
public static String getEmptyRevisionPattern() {
return EMPTY_REVISION_INFO;
}
public static List<FilePatch> buildPatch(final Collection<BeforeAfter<AirContentRevision>> changes, @NotNull final String basePath,
final boolean reversePatch,
final boolean isCaseSensitive,