Skip to content

Commit 9440225

Browse files
Refactor comments for clarity in AdministrativeMonitor
1 parent a3f8311 commit 9440225

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

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

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@
7070
* If {@link #isActivated()} returns true, Jenkins will use the {@code message.jelly}
7171
* view of this object to render the warning text. This happens in the
7272
* {@code http://SERVER/jenkins/manage} page. This view should typically render
73-
* a DIV box with class='alert alert-danger' or class='alert alert-warning' with
74-
* a human-readable text
73+
* a DIV box with class='alert alert-danger' or class='alert alert-warning' with a human-readable text
7574
* inside it. It often also contains a link to a page that provides more details
7675
* about the problem.<br>
7776
* Additionally 2 numbers are shown in the Jenkins header of administrators, one with the number or active
@@ -81,10 +80,10 @@
8180
*
8281
* <h3>Use with System Read permission</h3>
8382
* <p>
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.
87-
* For more details, see {@link #getRequiredPermission()}.
83+
* By default administrative monitors are visible only to users with Administer permission.
84+
* Users with {@link Jenkins#SYSTEM_READ} permission can access administrative monitors that override {@link #getRequiredPermission()}.
85+
* Care needs to be taken to ensure users with that permission don't have access to actions modifying system state.
86+
* For more details, see {@link #getRequiredPermission()}.
8887
* </p>
8988
*
9089
* @author Kohsuke Kawaguchi
@@ -111,8 +110,7 @@ protected AdministrativeMonitor() {
111110
}
112111

113112
/**
114-
* Returns the URL of this monitor, relative to the context path, like
115-
* "administrativeMonitor/foobar".
113+
* Returns the URL of this monitor, relative to the context path, like "administrativeMonitor/foobar".
116114
*/
117115
public String getUrl() {
118116
return "administrativeMonitor/" + id;
@@ -147,7 +145,8 @@ public void disable(boolean value) throws IOException {
147145
* Returns true if this monitor {@link #disable(boolean) isn't disabled} earlier.
148146
*
149147
* <p>
150-
* This flag implements the ability for the admin to say "no thank you" to the monitor that he wants to ignore.
148+
* This flag implements the ability for the admin to say "no thank you" to the monitor that
149+
* he wants to ignore.
151150
*/
152151
public boolean isEnabled() {
153152
if (isSnoozed()) {
@@ -298,21 +297,18 @@ public void doSnooze(StaplerRequest2 req, StaplerResponse2 rsp) throws IOExcepti
298297
* Required permission to view this admin monitor.
299298
* By default {@link Jenkins#ADMINISTER}, but {@link Jenkins#SYSTEM_READ} or {@link Jenkins#MANAGE} are also supported.
300299
* <p>
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.
300+
* Changing this permission check to return {@link Jenkins#SYSTEM_READ} will make the active
301+
* administrative monitor appear on {@link ManageJenkinsAction} to users without Administer permission.
302+
* {@link #doDisable(StaplerRequest2, StaplerResponse2)} will still always require Administer permission.
304303
* </p>
305304
* <p>
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.
305+
* This method only allows for a single permission to be returned. If more complex permission checks are required,
306+
* override {@link #checkRequiredPermission()} and {@link #hasRequiredPermission()} instead.
308307
* </p>
309308
* <p>
310-
* Implementers need to ensure that {@code doAct} and other web methods perform
311-
* necessary permission checks:
312-
* Users with System Read permissions are expected to be limited to read-only
313-
* access.
314-
* Form UI elements that change system state, e.g. toggling a feature on or off,
315-
* need to be hidden from users
309+
* Implementers need to ensure that {@code doAct} and other web methods perform necessary permission checks:
310+
* Users with System Read permissions are expected to be limited to read-only access.
311+
* Form UI elements that change system state, e.g. toggling a feature on or off, need to be hidden from users
316312
* lacking Administer permission.
317313
* </p>
318314
*
@@ -330,7 +326,6 @@ public Permission getRequiredPermission() {
330326
* Subclasses may override this method and {@link #hasRequiredPermission()} instead of {@link #getRequiredPermission()} to perform more complex permission checks,
331327
* for example, checking either {@link Jenkins#MANAGE} or {@link Jenkins#SYSTEM_READ}.
332328
* </p>
333-
*
334329
* @see #getRequiredPermission()
335330
* @see #hasRequiredPermission()
336331
* @since 2.468
@@ -345,7 +340,6 @@ public void checkRequiredPermission() {
345340
* Subclasses may override this method and {@link #checkRequiredPermission} instead of {@link #getRequiredPermission()} to perform more complex permission checks,
346341
* for example, checking either {@link Jenkins#MANAGE} or {@link Jenkins#SYSTEM_READ}.
347342
* </p>
348-
*
349343
* @see #getRequiredPermission()
350344
* @see #checkRequiredPermission()
351345
* @since 2.468

0 commit comments

Comments
 (0)