From 56b1af1554bb61b9a4aa369b7ca35210908490af Mon Sep 17 00:00:00 2001
From: Mark Craig <mark.craig@forgerock.com>
Date: Fri, 27 Apr 2012 15:28:49 +0000
Subject: [PATCH] Review comments from Matt

---
 opendj3/src/main/docbkx/dev-guide/chap-writing.xml |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/opendj3/src/main/docbkx/dev-guide/chap-writing.xml b/opendj3/src/main/docbkx/dev-guide/chap-writing.xml
index f1bfcb4..4858c48 100644
--- a/opendj3/src/main/docbkx/dev-guide/chap-writing.xml
+++ b/opendj3/src/main/docbkx/dev-guide/chap-writing.xml
@@ -113,14 +113,14 @@
 
   <programlisting language="java">// An entry to add to the directory
 DN entryDN = DN.valueOf("cn=Bob,ou=People,dc=example,dc=com");
-Entry entry = new TreeMapEntry(entryDN);
-entry.addAttribute("cn", "Bob");
-entry.addAttribute("objectclass", "top");
-entry.addAttribute("objectclass", "person");
-entry.addAttribute("objectclass", "organizationalPerson");
-entry.addAttribute("objectclass", "inetOrgPerson");
-entry.addAttribute("mail", "subgenius@example.com");
-entry.addAttribute("sn", "Dobbs");
+Entry entry = new TreeMapEntry(entryDN.toString())
+    .addAttribute("cn", "Bob")
+    .addAttribute("objectclass", "top")
+    .addAttribute("objectclass", "person")
+    .addAttribute("objectclass", "organizationalPerson")
+    .addAttribute("objectclass", "inetOrgPerson")
+    .addAttribute("mail", "subgenius@example.com")
+    .addAttribute("sn", "Dobbs");
 
 final LDAPConnectionFactory factory = new LDAPConnectionFactory(host, port);
 Connection connection = null;
@@ -163,8 +163,8 @@
 
     // Here, entry is a user entry with DN cn=Bob,ou=People,dc=example,dc=com.
     Entry old = TreeMapEntry.deepCopyOfEntry(entry);
-    entry = entry.replaceAttribute("mail", "spammer@example.com");
-    entry = entry.addAttribute("description", "I see the fnords.");
+    entry = entry.replaceAttribute("mail", "spammer@example.com")
+            .addAttribute("description", "I see the fnords.");
     ModifyRequest request = Entries.diffEntries(old, entry);
 
     connection.modify(request);

--
Gitblit v1.10.0