Browse Source

CommitBuilder: Deprecate setEncoding(String)

Deprecate the method in favor of setEncoding(Charset).

Update the only caller in the code base that was still using
the deprecated variant.

Change-Id: I6357f2d0c727007013c72e9d5b7c72a3f5f3f2b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago committed by Matthias Sohn
parent
commit
0368906353
  1. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java
  2. 2
      org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java

@ -538,7 +538,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
4294967295000L, 60)); 4294967295000L, 60));
commit.setCommitter(new PersonIdent("Joe Hacker", "joe2@example.com", commit.setCommitter(new PersonIdent("Joe Hacker", "joe2@example.com",
4294967295000L, 60)); 4294967295000L, 60));
commit.setEncoding("ISO-8859-1"); commit.setEncoding(ISO_8859_1);
commit.setMessage("\u00dcbergeeks"); commit.setMessage("\u00dcbergeeks");
ObjectId cid = insertCommit(commit); ObjectId cid = insertCommit(commit);
assertEquals("2979b39d385014b33287054b87f77bcb3ecb5ebf", cid.name()); assertEquals("2979b39d385014b33287054b87f77bcb3ecb5ebf", cid.name());

2
org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java

@ -295,7 +295,9 @@ public class CommitBuilder {
* @param encodingName * @param encodingName
* the encoding name. See * the encoding name. See
* {@link java.nio.charset.Charset#forName(String)}. * {@link java.nio.charset.Charset#forName(String)}.
* @deprecated use {@link #setEncoding(Charset)} instead.
*/ */
@Deprecated
public void setEncoding(String encodingName) { public void setEncoding(String encodingName) {
encoding = Charset.forName(encodingName); encoding = Charset.forName(encodingName);
} }

Loading…
Cancel
Save