Skip to content

Commit a3f8311

Browse files
Fix formatting and comments in AdministrativeMonitor.java
1 parent 9105aae commit a3f8311

File tree

1 file changed

+27
-58
lines changed

1 file changed

+27
-58
lines changed

core/src/main/java/hudson/model/AdministrativeMonitor.java

Lines changed: 27 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -57,41 +57,33 @@
5757
* monitoring and activate/deactivate the monitor accordingly. Sometimes
5858
* this can be done by updating a flag from code (see {@link SCMTrigger}
5959
* for one such example), while other times it's more convenient to do
60-
* so by running some code periodically (for this, use
61-
* {@link TimerTrigger#timer})
60+
* so by running some code periodically (for this, use {@link TimerTrigger#timer})
6261
*
6362
* <p>
64-
* {@link AdministrativeMonitor}s are bound to URL by
65-
* {@link Jenkins#getAdministrativeMonitor(String)}.
63+
* {@link AdministrativeMonitor}s are bound to URL by {@link Jenkins#getAdministrativeMonitor(String)}.
6664
* See {@link #getUrl()}.
6765
*
6866
* <h3>Views</h3>
6967
* <dl>
7068
* <dt>message.jelly</dt>
7169
* <dd>
72-
* If {@link #isActivated()} returns true, Jenkins will use the
73-
* {@code message.jelly}
70+
* If {@link #isActivated()} returns true, Jenkins will use the {@code message.jelly}
7471
* view of this object to render the warning text. This happens in the
7572
* {@code http://SERVER/jenkins/manage} page. This view should typically render
7673
* a DIV box with class='alert alert-danger' or class='alert alert-warning' with
7774
* a human-readable text
7875
* inside it. It often also contains a link to a page that provides more details
7976
* about the problem.<br>
80-
* Additionally 2 numbers are shown in the Jenkins header of administrators, one
81-
* with the number or active
82-
* non-security relevant monitors and one with the number of active security
83-
* relevant monitors.
77+
* Additionally 2 numbers are shown in the Jenkins header of administrators, one with the number or active
78+
* non-security relevant monitors and one with the number of active security relevant monitors.
8479
* </dd>
8580
* </dl>
8681
*
8782
* <h3>Use with System Read permission</h3>
8883
* <p>
89-
* By default administrative monitors are visible only to users with Administer
90-
* permission.
91-
* Users with {@link Jenkins#SYSTEM_READ} permission can access administrative
92-
* monitors that override {@link #getRequiredPermission()}.
93-
* Care needs to be taken to ensure users with that permission don't have access
94-
* to actions modifying system state.
84+
* By default administrative monitors are visible only to users with Administer permission.
85+
* Users with {@link Jenkins#SYSTEM_READ} permission can access administrative monitors that override {@link #getRequiredPermission()}.
86+
* Care needs to be taken to ensure users with that permission don't have access to actions modifying system state.
9587
* For more details, see {@link #getRequiredPermission()}.
9688
* </p>
9789
*
@@ -103,9 +95,7 @@ public abstract class AdministrativeMonitor extends AbstractModelObject implemen
10395
private static final Logger LOGGER = Logger.getLogger(AdministrativeMonitor.class.getName());
10496

10597
/**
106-
* Human-readable ID of this monitor, which needs to be unique within the
107-
* system.
108-
*
98+
* Human-readable ID of this monitor, which needs to be unique within the system.
10999
* <p>
110100
* This ID is used to remember persisted setting for this monitor,
111101
* so the ID should remain consistent beyond the Hudson JVM lifespan.
@@ -154,13 +144,10 @@ public void disable(boolean value) throws IOException {
154144
}
155145

156146
/**
157-
* Returns true if this monitor {@link #disable(boolean) isn't disabled}
158-
* earlier.
147+
* Returns true if this monitor {@link #disable(boolean) isn't disabled} earlier.
159148
*
160149
* <p>
161-
* This flag implements the ability for the admin to say "no thank you" to the
162-
* monitor that
163-
* he wants to ignore.
150+
* This flag implements the ability for the admin to say "no thank you" to the monitor that he wants to ignore.
164151
*/
165152
public boolean isEnabled() {
166153
if (isSnoozed()) {
@@ -309,21 +296,15 @@ public void doSnooze(StaplerRequest2 req, StaplerResponse2 rsp) throws IOExcepti
309296

310297
/**
311298
* Required permission to view this admin monitor.
312-
* By default {@link Jenkins#ADMINISTER}, but {@link Jenkins#SYSTEM_READ} or
313-
* {@link Jenkins#MANAGE} are also supported.
299+
* By default {@link Jenkins#ADMINISTER}, but {@link Jenkins#SYSTEM_READ} or {@link Jenkins#MANAGE} are also supported.
314300
* <p>
315-
* Changing this permission check to return {@link Jenkins#SYSTEM_READ} will
316-
* make the active
317-
* administrative monitor appear on {@link ManageJenkinsAction} to users without
318-
* Administer permission.
319-
* {@link #doDisable(StaplerRequest2, StaplerResponse2)} will still always
320-
* require Administer permission.
301+
* Changing this permission check to return {@link Jenkins#SYSTEM_READ} will make the active
302+
* administrative monitor appear on {@link ManageJenkinsAction} to users without Administer permission.
303+
* {@link #doDisable(StaplerRequest2, StaplerResponse2)} will still always require Administer permission.
321304
* </p>
322305
* <p>
323-
* This method only allows for a single permission to be returned. If more
324-
* complex permission checks are required,
325-
* override {@link #checkRequiredPermission()} and
326-
* {@link #hasRequiredPermission()} instead.
306+
* This method only allows for a single permission to be returned. If more complex permission checks are required,
307+
* override {@link #checkRequiredPermission()} and {@link #hasRequiredPermission()} instead.
327308
* </p>
328309
* <p>
329310
* Implementers need to ensure that {@code doAct} and other web methods perform
@@ -336,23 +317,18 @@ public void doSnooze(StaplerRequest2 req, StaplerResponse2 rsp) throws IOExcepti
336317
* </p>
337318
*
338319
* @since 2.233
339-
* @deprecated Callers should use {@link #checkRequiredPermission()} or
340-
* {@link #hasRequiredPermission()}.
320+
* @deprecated Callers should use {@link #checkRequiredPermission()} or {@link #hasRequiredPermission()}.
341321
*/
342322
@Deprecated
343323
public Permission getRequiredPermission() {
344324
return Jenkins.ADMINISTER;
345325
}
346326

347327
/**
348-
* Checks if the current user has the minimum required permission to view this
349-
* administrative monitor.
328+
* Checks if the current user has the minimum required permission to view this administrative monitor.
350329
* <p>
351-
* Subclasses may override this method and {@link #hasRequiredPermission()}
352-
* instead of {@link #getRequiredPermission()} to perform more complex
353-
* permission checks,
354-
* for example, checking either {@link Jenkins#MANAGE} or
355-
* {@link Jenkins#SYSTEM_READ}.
330+
* Subclasses may override this method and {@link #hasRequiredPermission()} instead of {@link #getRequiredPermission()} to perform more complex permission checks,
331+
* for example, checking either {@link Jenkins#MANAGE} or {@link Jenkins#SYSTEM_READ}.
356332
* </p>
357333
*
358334
* @see #getRequiredPermission()
@@ -364,14 +340,10 @@ public void checkRequiredPermission() {
364340
}
365341

366342
/**
367-
* Checks if the current user has the minimum required permission to view this
368-
* administrative monitor.
343+
* Checks if the current user has the minimum required permission to view this administrative monitor.
369344
* <p>
370-
* Subclasses may override this method and {@link #checkRequiredPermission}
371-
* instead of {@link #getRequiredPermission()} to perform more complex
372-
* permission checks,
373-
* for example, checking either {@link Jenkins#MANAGE} or
374-
* {@link Jenkins#SYSTEM_READ}.
345+
* Subclasses may override this method and {@link #checkRequiredPermission} instead of {@link #getRequiredPermission()} to perform more complex permission checks,
346+
* for example, checking either {@link Jenkins#MANAGE} or {@link Jenkins#SYSTEM_READ}.
375347
* </p>
376348
*
377349
* @see #getRequiredPermission()
@@ -383,11 +355,9 @@ public boolean hasRequiredPermission() {
383355
}
384356

385357
/**
386-
* Checks if the current user has the minimum required permission to view any
387-
* administrative monitor.
358+
* Checks if the current user has the minimum required permission to view any administrative monitor.
388359
*
389-
* @return true if the current user has the minimum required permission to view
390-
* any administrative monitor.
360+
* @return true if the current user has the minimum required permission to view any administrative monitor.
391361
*
392362
* @since 2.468
393363
*/
@@ -396,8 +366,7 @@ public static boolean hasPermissionToDisplay() {
396366
}
397367

398368
/**
399-
* Ensure that URLs in this administrative monitor are only accessible to users
400-
* with {@link #getRequiredPermission()}.
369+
* Ensure that URLs in this administrative monitor are only accessible to users with {@link #getRequiredPermission()}.
401370
*/
402371
@Override
403372
@Restricted(NoExternalUse.class)

0 commit comments

Comments
 (0)