@@ -70,11 +70,11 @@ public COSIncrement(COSUpdateInfo incrementOrigin)
7070 }
7171
7272 /**
73- * Collect all updates made to the given {@link COSBase} and it's contained structures.<br>
73+ * Collect all updates made to the given {@link COSBase} and its contained structures.<br>
7474 * This shall forward all {@link COSUpdateInfo} objects to the proper specialized collection methods.
7575 *
7676 * @param base The {@link COSBase} updates shall be collected for.
77- * @return Returns {@code true}, if the {@link COSBase} represents a direct child structure, that would require it´s
77+ * @return Returns {@code true} if the {@link COSBase} represents a direct child structure, that would require its
7878 * parent to be updated instead.
7979 * @see #collect(COSDictionary)
8080 * @see #collect(COSArray)
@@ -93,7 +93,9 @@ private boolean collect(COSBase base)
9393 }
9494 else if (base instanceof COSObject )
9595 {
96- return collect ((COSObject ) base );
96+ collect ((COSObject ) base );
97+ // COSObjects by definition are indirect and shall never cause a parent structure to be updated.
98+ return false ;
9799 }
98100 else if (base instanceof COSArray )
99101 {
@@ -103,11 +105,11 @@ else if(base instanceof COSArray)
103105 }
104106
105107 /**
106- * Collect all updates made to the given {@link COSDictionary} and it's contained structures.
108+ * Collect all updates made to the given {@link COSDictionary} and its contained structures.
107109 *
108110 * @param dictionary The {@link COSDictionary} updates shall be collected for.
109- * @return Returns {@code true}, if the {@link COSDictionary} represents a direct child structure, that would
110- * require it´s parent to be updated instead.
111+ * @return Returns {@code true} if the {@link COSDictionary} represents a direct child structure
112+ * that would require its parent to be updated instead.
111113 */
112114 private boolean collect (COSDictionary dictionary )
113115 {
@@ -157,10 +159,10 @@ private boolean collect(COSDictionary dictionary)
157159 }
158160
159161 /**
160- * Collect all updates made to the given {@link COSArray} and it's contained structures.
162+ * Collect all updates made to the given {@link COSArray} and its contained structures.
161163 *
162164 * @param array The {@link COSDictionary} updates shall be collected for.
163- * @return Returns {@code true}, if the {@link COSArray}´s elements changed. A {@link COSArray} shall always be
165+ * @return Returns {@code true} if the {@link COSArray}´s elements changed. A {@link COSArray} shall always be
164166 * treated as a direct structure, that would require it´s parent to be updated instead.
165167 */
166168 private boolean collect (COSArray array )
@@ -184,17 +186,15 @@ private boolean collect(COSArray array)
184186 }
185187
186188 /**
187- * Collect all updates made to the given {@link COSObject} and it's contained structures.
189+ * Collect all updates made to the given {@link COSObject} and its contained structures.
188190 *
189191 * @param object The {@link COSObject} updates shall be collected for.
190- * @return Always returns {@code false}. {@link COSObject}s by definition are indirect and shall never cause a
191- * parent structure to be updated.
192192 */
193- private boolean collect (COSObject object )
193+ private void collect (COSObject object )
194194 {
195195 if (contains (object ))
196196 {
197- return false ;
197+ return ;
198198 }
199199 addProcessedObject (object );
200200 COSUpdateState updateState = object .getUpdateState ();
@@ -213,7 +213,7 @@ private boolean collect(COSObject object)
213213 // Skip?
214214 if (actual == null || contains (actual .getCOSObject ()))
215215 {
216- return false ;
216+ return ;
217217 }
218218 boolean childDemandsParentUpdate = false ;
219219 COSUpdateState actualUpdateState = actual .getUpdateState ();
@@ -227,15 +227,14 @@ private boolean collect(COSObject object)
227227 {
228228 add (actual .getCOSObject ());
229229 }
230- return false ;
231230 }
232231
233232 /**
234- * Returns {@code true}, if the given {@link COSBase} is already known to and has been processed by this
233+ * Returns {@code true} if the given {@link COSBase} is already known to and has been processed by this
235234 * {@link COSIncrement}.
236235 *
237236 * @param base The {@link COSBase} to check.
238- * @return {@code true}, if the given {@link COSBase} is already known to and has been processed by this
237+ * @return {@code true} if the given {@link COSBase} is already known to and has been processed by this
239238 * {@link COSIncrement}.
240239 * @see #objects
241240 * @see #processedObjects
@@ -251,7 +250,7 @@ public boolean contains(COSBase base)
251250 * Should that be the case, the {@link COSUpdateState} originates from another {@link COSDocument} and must be added
252251 * to the {@link COSIncrement}, hence call {@link COSUpdateState#update()}.
253252 *
254- * @param updateState The {@link COSUpdateState} that shall be updated, if it's originating from another
253+ * @param updateState The {@link COSUpdateState} that shall be updated, if its originating from another
255254 * {@link COSDocument}.
256255 * @see #incrementOrigin
257256 */
@@ -314,11 +313,11 @@ public COSIncrement exclude(COSBase... base)
314313 }
315314
316315 /**
317- * Returns {@code true}, if the given {@link COSBase} has been excluded from the increment, and hence is contained
316+ * Returns {@code true} if the given {@link COSBase} has been excluded from the increment, and hence is contained
318317 * in {@link #excluded}.
319318 *
320319 * @param base The {@link COSBase} to check for exclusion.
321- * @return {@code true}, if the given {@link COSBase} has been excluded from the increment, and hence is contained
320+ * @return {@code true} if the given {@link COSBase} has been excluded from the increment, and hence is contained
322321 * in {@link #excluded}.
323322 * @see #excluded
324323 */
0 commit comments