Skip to content

Commit a1ae219

Browse files
committed
Put lazy init methods before other helper methods
Consistency!
1 parent e4ae9ee commit a1ae219

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

src/main/java/org/scijava/module/AbstractModuleInfo.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,6 @@ protected List<ModuleItem<?>> outputList() {
158158
return outputList;
159159
}
160160

161-
// -- Helper methods --
162-
163-
private <T> ModuleItem<T> castItem(final ModuleItem<?> item,
164-
final Class<T> type)
165-
{
166-
final Class<?> itemType = item.getType();
167-
// if (!type.isAssignableFrom(itemType)) {
168-
final Class<?> saneItemType = Types.box(itemType);
169-
if (!Types.isAssignable(type, saneItemType)) {
170-
throw new IllegalArgumentException("Type " + type.getName() +
171-
" is incompatible with item of type " + itemType.getName());
172-
}
173-
@SuppressWarnings("unchecked")
174-
final ModuleItem<T> typedItem = (ModuleItem<T>) item;
175-
return typedItem;
176-
}
177-
178161
// -- Helper methods - lazy initialization --
179162

180163
/** Initializes data structures and parses parameters. */
@@ -191,4 +174,20 @@ private synchronized void initParameters() {
191174
initialized = true;
192175
}
193176

177+
// -- Helper methods --
178+
179+
private <T> ModuleItem<T> castItem(final ModuleItem<?> item,
180+
final Class<T> type)
181+
{
182+
final Class<?> itemType = item.getType();
183+
// if (!type.isAssignableFrom(itemType)) {
184+
final Class<?> saneItemType = Types.box(itemType);
185+
if (!Types.isAssignable(type, saneItemType)) {
186+
throw new IllegalArgumentException("Type " + type.getName() +
187+
" is incompatible with item of type " + itemType.getName());
188+
}
189+
@SuppressWarnings("unchecked")
190+
final ModuleItem<T> typedItem = (ModuleItem<T>) item;
191+
return typedItem;
192+
}
194193
}

0 commit comments

Comments
 (0)