Skip to content

Commit 50fd128

Browse files
idodeclareVladimir Kotal
authored andcommitted
Check validateUniversalCtags() from web too
1 parent adc0ce1 commit 50fd128

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ public List<String> getArgv() {
148148
}
149149

150150
private void initialize() {
151+
/*
152+
* Call the following principally to properly initialize when running
153+
* JUnit tests. opengrok-indexer and opengrok-web call it too but
154+
* validating its return code and logging (and possibly aborting).
155+
*/
151156
env.validateUniversalCtags();
152157

153158
command = new ArrayList<>();

opengrok-web/src/main/java/org/opengrok/web/WebappListener.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2018, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2018-2019, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opengrok.web;
2525

@@ -77,14 +77,18 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
7777
}
7878
}
7979

80-
/**
80+
/*
8181
* Create a new instance of authorization framework. If the code above
8282
* (reading the configuration) failed then the plugin directory is
8383
* possibly {@code null} causing the framework to allow every request.
8484
*/
8585
env.setAuthorizationFramework(new AuthorizationFramework(env.getPluginDirectory(), env.getPluginStack()));
8686
env.getAuthorizationFramework().reload();
8787

88+
if (env.isWebappCtags() && !env.validateUniversalCtags()) {
89+
LOGGER.warning("Didn't find Universal Ctags for --webappCtags");
90+
}
91+
8892
try {
8993
loadStatistics();
9094
} catch (IOException ex) {
@@ -93,7 +97,7 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
9397

9498
String pluginDirectory = env.getPluginDirectory();
9599
if (pluginDirectory != null && env.isAuthorizationWatchdog()) {
96-
RuntimeEnvironment.getInstance().watchDog.start(new File(pluginDirectory));
100+
env.watchDog.start(new File(pluginDirectory));
97101
}
98102

99103
env.startExpirationTimer();

0 commit comments

Comments
 (0)