@@ -277,36 +277,36 @@ protected void addPlugin(AuthorizationStack stack, AuthorizationEntity entity) {
277
277
}
278
278
279
279
/**
280
- * Add a plugin into the plugin stack. This has the same effect as invoking
280
+ * Add a plug-in into the plug-in stack. This has the same effect as invoking
281
281
* addPlugin(stack, IAuthorizationPlugin, REQUIRED).
282
282
*
283
283
* @param stack the stack
284
- * @param plugin the authorization plugin
284
+ * @param plugin the authorization plug-in
285
285
*/
286
286
public void addPlugin (AuthorizationStack stack , IAuthorizationPlugin plugin ) {
287
287
addPlugin (stack , plugin , AuthControlFlag .REQUIRED );
288
288
}
289
289
290
290
/**
291
- * Add a plugin into the plugin array.
291
+ * Add a plug-in into the plug-in array.
292
292
*
293
293
* <h3>Configured plugin</h3>
294
- * For plugin which have an entry in configuration, the new plugin is put in
295
- * the place respecting the user-defined order of execution.
294
+ * For plug-in that has an entry in configuration, the new plug-in is put
295
+ * in the place respecting the user-defined order of execution.
296
296
*
297
297
* <h3>New plugin</h3>
298
298
* If there is no entry in configuration for this class, the plugin is
299
299
* appended to the end of the plugin stack with flag <code>flag</code>
300
+ *
301
+ * <p><b>The plug-in's load method is NOT invoked at this point</b></p>
300
302
*
301
- * <p>
302
- * <b>The plugin's load method is NOT invoked at this point</b></p>
303
- *
304
- * This has the same effect as invoking addPlugin(new
305
- * AuthorizationEntity(stack, flag, getClassName(plugin), plugin).
303
+ * This has the same effect as invoking
304
+ * {@code addPlugin(new AuthorizationEntity(stack, flag,
305
+ * getClassName(plugin), plugin)}.
306
306
*
307
307
* @param stack the stack
308
- * @param plugin the authorization plugin
309
- * @param flag the flag for the new plugin
308
+ * @param plugin the authorization plug-in
309
+ * @param flag the flag for the new plug-in
310
310
*/
311
311
public void addPlugin (AuthorizationStack stack , IAuthorizationPlugin plugin , AuthControlFlag flag ) {
312
312
if (stack != null ) {
@@ -452,15 +452,15 @@ protected List<Class> getInterfaces(Class c) {
452
452
*/
453
453
private void loadClasses (AuthorizationStack stack , List <File > classfiles , List <File > jarfiles ) {
454
454
IAuthorizationPlugin pf ;
455
+
455
456
for (File file : classfiles ) {
456
457
String classname = getClassName (file );
457
458
if (classname .isEmpty ()) {
458
459
continue ;
459
460
}
460
- // load the class in memory and try to find a configured space for this class
461
- if ((pf = handleLoadClass (classname )) != null && !stack .setPlugin (pf )) {
462
- // if there is not configured space -> append it to the stack
463
- addPlugin (stack , pf );
461
+ // Load the class in memory and try to find a configured space for this class.
462
+ if ((pf = handleLoadClass (classname )) != null ) {
463
+ stack .setPlugin (pf );
464
464
}
465
465
}
466
466
@@ -473,10 +473,9 @@ private void loadClasses(AuthorizationStack stack, List<File> classfiles, List<F
473
473
if (!entry .getName ().endsWith (".class" ) || classname .isEmpty ()) {
474
474
continue ;
475
475
}
476
- // load the class in memory and try to find a configured space for this class
477
- if ((pf = handleLoadClass (classname )) != null && !stack .setPlugin (pf )) {
478
- // if there is not configured space -> append it to the stack
479
- addPlugin (stack , pf );
476
+ // Load the class in memory and try to find a configured space for this class.
477
+ if ((pf = handleLoadClass (classname )) != null ) {
478
+ stack .setPlugin (pf );
480
479
}
481
480
}
482
481
} catch (IOException ex ) {
0 commit comments