mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
LVTI: explicit variable type is redundant (IDEA-179177)
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
void m(String[] args){
|
||||
for ( var arg : args) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
{
|
||||
var str = m("hello, world");
|
||||
}
|
||||
|
||||
static <T> T m(T t) {return t;}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
{
|
||||
var args = new String[42];
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
{
|
||||
var i = 0;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
import java.io.*;
|
||||
class Main {
|
||||
void m(InputStream s){
|
||||
try ( var in = s) {}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>String[] args = {"hello, world"};
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>String args[] = new String[]{"hello, world"};
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>A<String> i = new A<>();
|
||||
}
|
||||
|
||||
static class A<T> {}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
void m(String[] args){
|
||||
for (<caret>String arg : args) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>Runnable r = () -> {};
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
{
|
||||
<caret>String str = m("hello, world");
|
||||
}
|
||||
|
||||
static <T> T m(T t) {return t;}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>String str = "", str1 = "";
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
{
|
||||
<caret>String[] args = new String[42];
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>String[] args;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>String str = m();
|
||||
}
|
||||
|
||||
static <T> T m() {return t;}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "false"
|
||||
class Main {
|
||||
{
|
||||
<caret>String[] args = null;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
class Main {
|
||||
{
|
||||
<caret>int i = 0;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Replace explicit type with 'var'" "true"
|
||||
import java.io.*;
|
||||
class Main {
|
||||
void m(InputStream s){
|
||||
try (<caret>InputStream in = s) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user