mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java: Convert intention "Join Declaration And Assignment" into inspection (IDEA-178919)
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
class C {
|
||||
void foo() {
|
||||
@A int n = 1;
|
||||
}
|
||||
@Target(ElementType.LOCAL_VARIABLE) @interface A {}
|
||||
}
|
||||
+10
-5
@@ -1,8 +1,13 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class Test {
|
||||
{
|
||||
String ss = "hello"; // comment A
|
||||
// comment B
|
||||
/*comment C*/ /*comment D*/ // comment E
|
||||
}
|
||||
{
|
||||
/*comment 1*/
|
||||
/*comment 2*/
|
||||
/*comment 3*/
|
||||
// comment 4
|
||||
// comment A
|
||||
/*comment B*/
|
||||
/*comment C*/
|
||||
String ss = "hello" + /*comment D*/ " world";/*comment E*/// comment F
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class Test {
|
||||
{
|
||||
String ss = "hello";
|
||||
String ss = "hello";
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class Test {
|
||||
{
|
||||
String ss = "hello", a = "";
|
||||
String a = "";
|
||||
String ss = "hello";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Join declaration and assignment" "INFORMATION"
|
||||
class Test {
|
||||
{
|
||||
int i = 4 * (2 + 3);
|
||||
int i = 4 * (2 + 3);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Join declaration and assignment" "INFORMATION"
|
||||
class Test {
|
||||
{
|
||||
String ss = "hello" + "world";
|
||||
String ss = "hello" + "world";
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
class C {
|
||||
void foo() {
|
||||
@A @B int k, m;
|
||||
@A @B int n = 1;
|
||||
}
|
||||
@Target(ElementType.LOCAL_VARIABLE) @interface A {}
|
||||
@Target(ElementType.LOCAL_VARIABLE) @interface B {}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Join declaration and assignment" "INFORMATION"
|
||||
class C {
|
||||
int foo (int a, int b){
|
||||
int x = a;
|
||||
x = x * 31 + b;
|
||||
return x;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
class C {
|
||||
void foo() {
|
||||
@A int n;
|
||||
<caret>n = 1;
|
||||
}
|
||||
@Target(ElementType.LOCAL_VARIABLE) @interface A {}
|
||||
}
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class Test {
|
||||
{
|
||||
String s<caret>s = ""; // comment A
|
||||
// comment B
|
||||
/*comment C*/ ss /*comment D*/ = "hello"; // comment E
|
||||
}
|
||||
{
|
||||
String /*comment 1*/ s<caret>s /*comment 2*/ = "" /*comment 3*/; // comment 4
|
||||
// comment A
|
||||
/*comment B*/ ss /*comment C*/ = "hello" + /*comment D*/ " world" /*comment E*/; // comment F
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
class C {
|
||||
void foo() {
|
||||
@A @B int k, n, m;
|
||||
<caret>n = 1;
|
||||
}
|
||||
@Target(ElementType.LOCAL_VARIABLE) @interface A {}
|
||||
@Target(ElementType.LOCAL_VARIABLE) @interface B {}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Join declaration and assignment" "INFORMATION"
|
||||
class C {
|
||||
int foo (int a, int b){
|
||||
int x;
|
||||
<caret>x = a;
|
||||
x = x * 31 + b;
|
||||
return x;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user