Skip to content

Commit b44dc31

Browse files
committed
ObjectIndex: eliminate long lines
1 parent 3333aff commit b44dc31

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/main/java/org/scijava/object/ObjectIndex.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@
5555
* <p>
5656
* The object index keeps lists of objects segregated by type. The type
5757
* hierarchy beneath which each object is classified can be customized through
58-
* subclassing (e.g., see {@link org.scijava.plugin.PluginIndex}), but by default,
59-
* each registered object is added to all type lists with which its class is
60-
* compatible. For example, an object of type {@link String} would be added to
61-
* the following type lists: {@link String}, {@link java.io.Serializable},
62-
* {@link Comparable}, {@link CharSequence} and {@link Object}. A subsequent
63-
* request for all objects of type {@link Comparable} (via a call to
64-
* {@link #get(Class)}) would return a list that includes the object.
58+
* subclassing (e.g., see {@link org.scijava.plugin.PluginIndex}), but by
59+
* default, each registered object is added to all type lists with which its
60+
* class is compatible. For example, an object of type {@link String} would be
61+
* added to the following type lists: {@link String},
62+
* {@link java.io.Serializable}, {@link Comparable}, {@link CharSequence} and
63+
* {@link Object}. A subsequent request for all objects of type
64+
* {@link Comparable} (via a call to {@link #get(Class)}) would return a list
65+
* that includes the object.
6566
* </p>
6667
* <p>
6768
* Note that similar to {@link List}, it is possible for the same object to be
@@ -262,7 +263,8 @@ protected boolean remove(final Object o, final boolean batch) {
262263
return remove(o, getType(e), batch);
263264
}
264265

265-
private Map<Class<?>, List<E>[]> type2Lists = new HashMap<Class<?>, List<E>[]>();
266+
private Map<Class<?>, List<E>[]> type2Lists =
267+
new HashMap<Class<?>, List<E>[]>();
266268

267269
protected synchronized List<E>[] retrieveListsForType(final Class<?> type) {
268270
List<E>[] result = type2Lists.get(type);
@@ -312,7 +314,8 @@ protected boolean removeFromList(final Object obj, final List<E> list,
312314

313315
// -- Helper methods --
314316

315-
private static Map<Class<?>, Class<?>[]> typeMap = new HashMap<Class<?>, Class<?>[]>();
317+
private static Map<Class<?>, Class<?>[]> typeMap =
318+
new HashMap<Class<?>, Class<?>[]>();
316319

317320
/** Gets a new set containing the type and all its supertypes. */
318321
protected static synchronized Class<?>[] getTypes(final Class<?> type) {
@@ -327,7 +330,9 @@ protected static synchronized Class<?>[] getTypes(final Class<?> type) {
327330
}
328331

329332
/** Recursively adds the type and all its supertypes to the given set. */
330-
private static synchronized void getTypes(final Class<?> type, final Set<Class<?>> types) {
333+
private static synchronized void getTypes(final Class<?> type,
334+
final Set<Class<?>> types)
335+
{
331336
if (type == null) return;
332337
types.add(type);
333338

0 commit comments

Comments
 (0)