rspec/rules/S4275/rule.adoc

42 lines
555 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 12:49:37 +02:00
include::description.adoc[]
=== Noncompliant code example
[source,text]
----
class A {
private int x;
private int y;
public void setX(int val) { // Noncompliant: field 'x' is not updated
this.y = val;
}
public int getY() { // Noncompliant: field 'y' is not used in the return value
return this.x;
}
}
----
=== Compliant solution
[source,text]
----
class A {
private int x;
private int y;
public void setX(int val) {
this.x = val;
}
public int getY() {
return this.y;
}
}
----
2020-06-30 12:49:37 +02:00