File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/framework
opengrok-web/src/main/webapp Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,9 @@ private String getClassName(JarEntry f) {
337337
338338 /**
339339 * Perform custom operations before the plugins are loaded.
340+ * <p>
341+ * If this function returns {@code null}, the reloading is completely skipped and {@link #afterReload(Object)}
342+ * is never called.
340343 *
341344 * @return the implementor can generate custom data which will be later passed to {@link #afterReload(Object)}
342345 */
@@ -347,6 +350,9 @@ private String getClassName(JarEntry f) {
347350 * <p>
348351 * When this is invoked, all plugins has been loaded into the memory and for each available plugin
349352 * the {@link #classLoaded(Object, Object)} was invoked.
353+ * <p>
354+ * When {@link #beforeReload()} returns {@code null}, the reloading is skipped, and this method is
355+ * never called.
350356 *
351357 * @param data a custom data created with {@link #beforeReload()}
352358 */
@@ -363,6 +369,12 @@ public final void reload() {
363369 // notify the implementing class that the reload is about to begin
364370 final DataType localData = beforeReload ();
365371
372+ if (localData == null ) {
373+ // the implementor does not want to reload the plugins
374+ LOGGER .log (Level .WARNING , "Loading plugins from {0} as instructed by the implementer's class" , pluginDirectory );
375+ return ;
376+ }
377+
366378 try {
367379 if (pluginDirectory == null || !pluginDirectory .isDirectory () || !pluginDirectory .canRead ()) {
368380 LOGGER .log (Level .WARNING , "Plugin directory not found or not readable: {0}." , pluginDirectory );
Original file line number Diff line number Diff line change @@ -247,13 +247,8 @@ Click <a href="<%= rawPath %>">download <%= basename %></a><%
247247 }
248248 } else {
249249 // requesting a previous revision or needed to generate xref on the fly (economy mode).
250- <<<<<< < HEAD
251- AnalyzerFactory a = AnalyzerGuru . find(basename);
252- Genre g = AnalyzerGuru . getGenre(a);
253- ====== =
254250 AnalyzerFactory a = cfg. getEnv(). getAnalyzerGuru(). find(basename);
255251 AbstractAnalyzer . Genre g = cfg. getEnv(). getAnalyzerGuru(). getGenre(a);
256- >>>>>> > Introducing an plugin framework for analyzers
257252 String error = null ;
258253 if (g == Genre . PLAIN || g == Genre . HTML || g == null ) {
259254 InputStream in = null ;
You can’t perform that action at this time.
0 commit comments