Fix typos in S6212
This commit is contained in:
parent
59b21382c6
commit
decfcc38b1
@ -3,7 +3,7 @@ In Java 10 https://openjdk.java.net/jeps/286[Local-Variable Type Inference] was
|
||||
While it is not always possible or cleaner to use this new way of declaring a variable, when the type on the left is the same as the one on the right in an assignment, using the ``++var++`` will result in a more concise code.
|
||||
|
||||
|
||||
This rule reports an issue when the expected type of the variable is the same as the returned type of assigned expression and the type can be easily inferred by the reader, either when the tye is already mentioned in the name or the initializer, or when the expression is self-explained.
|
||||
This rule reports an issue when the expected type of the variable is the same as the returned type of assigned expression and the type can be easily inferred by the reader, either when the type is already mentioned in the name or the initializer, or when the expression is self-explained.
|
||||
|
||||
|
||||
== Noncompliant Code Example
|
||||
@ -12,11 +12,11 @@ This rule reports an issue when the expected type of the variable is the same as
|
||||
----
|
||||
MyClass myClass = new MyClass();
|
||||
|
||||
int i = 10; // Type is self explained
|
||||
int i = 10; // Type is self-explanatory
|
||||
|
||||
MyClass something = MyClass.getMyClass(); // Type is already mentionned in the initializer
|
||||
MyClass something = MyClass.getMyClass(); // Type is already mentioned in the initializer
|
||||
|
||||
MyClass myClass = get(); // Type is already mentionned in the name{code}
|
||||
MyClass myClass = get(); // Type is already mentioned in the name
|
||||
----
|
||||
|
||||
== Compliant Solution
|
||||
|
Loading…
x
Reference in New Issue
Block a user