File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
src/main/java/org/scijava/annotations Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -82,21 +82,25 @@ protected void discoverAnnotations(final File directory,
82
82
discoverAnnotations (file , classNamePrefix + file .getName () + "." ,
83
83
loader );
84
84
}
85
- else if (file .isFile ()) try {
85
+ else if (file .isFile ()) {
86
86
final String fileName = file .getName ();
87
87
if (!fileName .endsWith (".class" )) {
88
88
continue ;
89
89
}
90
90
final String className =
91
91
classNamePrefix + fileName .substring (0 , fileName .length () - 6 );
92
- final Class <?> clazz = loader .loadClass (className );
93
- for (final Annotation a : clazz .getAnnotations ()) {
94
- add (a , className );
92
+ try {
93
+ final Class <?> clazz = loader .loadClass (className );
94
+ for (final Annotation a : clazz .getAnnotations ()) {
95
+ add (a , className );
96
+ }
97
+ } catch (NoClassDefFoundError e ) {
98
+ System .err .println ("Warning: could not load class '" + className + "' ("
99
+ + e .getMessage () + "); skipping" );
100
+ } catch (ClassNotFoundException e ) {
101
+ System .err .println ("Warning: could not load class '" + className + "'; skipping" );
95
102
}
96
103
}
97
- catch (ClassNotFoundException e ) {
98
- throw new IOException (e );
99
- }
100
104
}
101
105
}
102
106
You can’t perform that action at this time.
0 commit comments