Console: _action cannot be null in processForm()

GraphHelper minor cleanup
This commit is contained in:
zzz
2018-12-23 13:38:54 +00:00
parent af49a90303
commit aad80eb2a3
8 changed files with 3 additions and 11 deletions

View File

@ -228,8 +228,6 @@ public class ConfigServiceHandler extends FormHandler {
@Override
protected void processForm() {
if (_action == null) return;
if (_t("Shutdown gracefully").equals(_action)) {
if (_context.hasWrapper())
registerWrapperNotifier(Router.EXIT_GRACEFUL, false);

View File

@ -157,8 +157,6 @@ public class ConfigUpdateHandler extends FormHandler {
@Override
protected void processForm() {
if (_action == null)
return;
if (_action.equals(_t("Check for updates"))) {
ConsoleUpdateManager mgr = UpdateHandler.updateManager(_context);
if (mgr == null) {

View File

@ -130,6 +130,7 @@ public abstract class FormHandler {
* Implement this to perform the final processing (in turn, adding formNotice
* and formError messages, etc)
*
* Will only be called if _action is non-null and the nonce is valid.
*/
protected abstract void processForm();

View File

@ -18,7 +18,6 @@ public class ConfigHomeHandler extends FormHandler {
@Override
protected void processForm() {
if (_action == null) return;
String group = getJettyString("group");
boolean deleting = _action.equals(_t("Delete selected"));
boolean adding = _action.equals(_t("Add item"));

View File

@ -15,7 +15,6 @@ public class ConfigKeyringHandler extends FormHandler {
@Override
protected void processForm() {
if (_action == null) return;
boolean adding = _action.equals(_t("Add key"));
if (adding || _action.equals(_t("Delete key"))) {
if (_peer == null)

View File

@ -20,7 +20,6 @@ public class ConfigSummaryHandler extends FormHandler {
@Override
protected void processForm() {
if (_action == null) return;
String group = getJettyString("group");
boolean deleting = _action.equals(_t("Delete selected"));
boolean adding = _action.equals(_t("Add item"));

View File

@ -395,10 +395,10 @@ public class GraphHelper extends FormHandler {
for (int i = 0; i < times.length; i++) {
_out.write("<option value=\"");
_out.write(Integer.toString(times[i]));
_out.write("\"");
_out.write('"');
if (times[i] == _refreshDelaySeconds)
_out.write(" selected=\"selected\"");
_out.write(">");
_out.write('>');
if (times[i] > 0)
_out.write(DataHelper.formatDuration2(times[i] * 1000));
else

View File

@ -28,8 +28,6 @@ public class WizardHandler extends FormHandler {
@Override
protected void processForm() {
if (_action == null)
return;
if (getJettyString("cancelbw") != null) {
cancelNDT();
for (int i = 0; i < 20 && !_helper.isNDTComplete(); i++) {