Browse Source

Remove dead RawText(RawTextComparator) constructor

Since the introduction of HashedSequence we no longer need to supply
the RawTextComparator at the time of constructing a RawText.  Drop the
definition from the constructor, because it doesn't make sense as part
of our public API.

Change-Id: Iaab34611d60eee4a2036830142b089b2dae81842
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.10
Shawn O. Pearce 14 years ago
parent
commit
3f3b6bfdb3
  1. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreAllWhitespaceTest.java
  2. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreLeadingWhitespaceTest.java
  3. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreTrailingWhitespaceTest.java
  4. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreWhitespaceChangeTest.java
  5. 15
      org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreAllWhitespaceTest.java

@ -52,9 +52,9 @@ public class RawTextIgnoreAllWhitespaceTest extends TestCase {
private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_ALL; private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_ALL;
public void testEqualsWithoutWhitespace() { public void testEqualsWithoutWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n")); .encodeASCII("foo-a\nfoo-b\nfoo\n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n")); .encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size()); assertEquals(3, a.size());
@ -74,9 +74,9 @@ public class RawTextIgnoreAllWhitespaceTest extends TestCase {
} }
public void testEqualsWithWhitespace() { public void testEqualsWithWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\na \n")); .encodeASCII("foo-a\n \n a b c\na \n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\n")); .encodeASCII("foo-a b\n\nab c\na\n"));
// "foo-a" != "foo-a b" // "foo-a" != "foo-a b"

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreLeadingWhitespaceTest.java

@ -52,9 +52,9 @@ public class RawTextIgnoreLeadingWhitespaceTest extends TestCase {
private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_LEADING; private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_LEADING;
public void testEqualsWithoutWhitespace() { public void testEqualsWithoutWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n")); .encodeASCII("foo-a\nfoo-b\nfoo\n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n")); .encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size()); assertEquals(3, a.size());
@ -74,9 +74,9 @@ public class RawTextIgnoreLeadingWhitespaceTest extends TestCase {
} }
public void testEqualsWithWhitespace() { public void testEqualsWithWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\n a\nb \n")); .encodeASCII("foo-a\n \n a b c\n a\nb \n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\nb\n")); .encodeASCII("foo-a b\n\nab c\na\nb\n"));
// "foo-a" != "foo-a b" // "foo-a" != "foo-a b"

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreTrailingWhitespaceTest.java

@ -52,9 +52,9 @@ public class RawTextIgnoreTrailingWhitespaceTest extends TestCase {
private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_TRAILING; private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_TRAILING;
public void testEqualsWithoutWhitespace() { public void testEqualsWithoutWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n")); .encodeASCII("foo-a\nfoo-b\nfoo\n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n")); .encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size()); assertEquals(3, a.size());
@ -74,9 +74,9 @@ public class RawTextIgnoreTrailingWhitespaceTest extends TestCase {
} }
public void testEqualsWithWhitespace() { public void testEqualsWithWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\na \n b\n")); .encodeASCII("foo-a\n \n a b c\na \n b\n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\nb\n")); .encodeASCII("foo-a b\n\nab c\na\nb\n"));
// "foo-a" != "foo-a b" // "foo-a" != "foo-a b"

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RawTextIgnoreWhitespaceChangeTest.java

@ -52,9 +52,9 @@ public class RawTextIgnoreWhitespaceChangeTest extends TestCase {
private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_CHANGE; private final RawTextComparator cmp = RawTextComparator.WS_IGNORE_CHANGE;
public void testEqualsWithoutWhitespace() { public void testEqualsWithoutWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\nfoo-b\nfoo\n")); .encodeASCII("foo-a\nfoo-b\nfoo\n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-b\nfoo-c\nf\n")); .encodeASCII("foo-b\nfoo-c\nf\n"));
assertEquals(3, a.size()); assertEquals(3, a.size());
@ -74,9 +74,9 @@ public class RawTextIgnoreWhitespaceChangeTest extends TestCase {
} }
public void testEqualsWithWhitespace() { public void testEqualsWithWhitespace() {
final RawText a = new RawText(cmp, Constants final RawText a = new RawText(Constants
.encodeASCII("foo-a\n \n a b c\na \n foo\na b c\n")); .encodeASCII("foo-a\n \n a b c\na \n foo\na b c\n"));
final RawText b = new RawText(cmp, Constants final RawText b = new RawText(Constants
.encodeASCII("foo-a b\n\nab c\na\nfoo\na b c \n")); .encodeASCII("foo-a b\n\nab c\na\nfoo\na b c \n"));
// "foo-a" != "foo-a b" // "foo-a" != "foo-a b"

15
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java

@ -85,21 +85,6 @@ public class RawText extends Sequence {
* through cached arrays is safe. * through cached arrays is safe.
*/ */
public RawText(final byte[] input) { public RawText(final byte[] input) {
this(RawTextComparator.DEFAULT, input);
}
/**
* Create a new sequence from an existing content byte array.
*
* The entire array (indexes 0 through length-1) is used as the content.
*
* @param cmp
* comparator that will later be used to compare texts.
* @param input
* the content array. The array is never modified, so passing
* through cached arrays is safe.
*/
public RawText(RawTextComparator cmp, byte[] input) {
content = input; content = input;
lines = RawParseUtils.lineMap(content, 0, content.length); lines = RawParseUtils.lineMap(content, 0, content.length);
} }

Loading…
Cancel
Save