Proposed Rule Name: UseExplicitTypes
Proposed Category: One of [Best Practices | Error Prone]
Description:
Java 10 introduced the var
keyword. This reduces the amount of typing but decreases the reading comprehension of the code. Please create a rule that flags the use of the var keyword.
Code Sample:
The line with var index
should be flagged as a problem.
public static void myMethod()
{
var index = 0;
}
Here is the "correct" code.
public static void myMethod()
{
int index = 0;
}
Possible Properties:
disallow
.disallow
.disallow
.disallow
. If true
, then var
can replace a primitive type as long as one of the above properties allows the location.Are there any other places where var
can be used? If so, add those as properties.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4