Refactoring creation of the lesson moving it towards the plugin

This commit is contained in:
nbaars
2015-03-01 15:59:42 +01:00
parent 4865a4b606
commit 3e9331d46e
3 changed files with 14 additions and 9 deletions

View File

@ -304,12 +304,8 @@ public class Course {
List<Plugin> plugins = new PluginsLoader(Paths.get(pluginPath), Paths.get(targetPath)).loadPlugins(true);
for (Plugin plugin : plugins) {
try {
Class<AbstractLesson> c = plugin.getLesson();
Object o = c.newInstance();
AbstractLesson lesson = (AbstractLesson) o;
AbstractLesson lesson = plugin.getLesson();
lesson.setWebgoatContext(webgoatContext);
lesson.update(properties);
if (!lesson.getHidden()) {