2020-06-30 12:48:39 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
public void makeItPublic(String methodName) throws NoSuchMethodException {
|
|
|
|
|
|
|
|
this.getClass().getMethod(methodName).setAccessible(true); // Noncompliant
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setItAnyway(String fieldName, int value) {
|
|
|
|
this.getClass().getDeclaredField(fieldName).setInt(this, value); // Noncompliant; bypasses controls in setter
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
|
|
|
ifdef::rspecator-view[]
|
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::rspecator-view[]
|