aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java7
2 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java
index 1515a07ac4..48d2c480a9 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java
@@ -92,8 +92,10 @@ public class T0001_PersonIdentTest {
PersonIdent personIdent = new PersonIdent(" A U Thor ",
" author@example.com ");
- String externalString = personIdent.toExternalString();
+ assertEquals(" A U Thor ", personIdent.getName());
+ assertEquals(" author@example.com ", personIdent.getEmailAddress());
+ String externalString = personIdent.toExternalString();
assertTrue(externalString.startsWith("A U Thor <author@example.com>"));
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
index 2ecc60c3b6..aa304634ba 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
@@ -217,7 +217,12 @@ public class PersonIdent implements Serializable {
}
/**
- * Construct a {@link PersonIdent}
+ * Construct a {@link PersonIdent}.
+ * <p>
+ * Whitespace in the name and email is preserved for the lifetime of this
+ * object, but are trimmed by {@link #toExternalString()}. This means that
+ * parsing the result of {@link #toExternalString()} may not return an
+ * equivalent instance.
*
* @param aName
* @param aEmailAddress