mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
IDEA-115867 Copy to temp final variable does not work correctly inside expression without braces
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// "Copy 'i' to temp final variable" "true"
|
||||
class ParamTypeBug {
|
||||
private static String strings[] = new String[]{ "a", "b", "c" };
|
||||
|
||||
public static void main(final String ... args){
|
||||
if (args.length == 1){
|
||||
for(int i = 0; i < strings.length; i++) {
|
||||
final int finalI = i;
|
||||
new Thread(){
|
||||
public void run(){
|
||||
new String(strings[finalI]);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Copy 'i' to temp final variable" "true"
|
||||
class ParamTypeBug {
|
||||
private static String strings[] = new String[]{ "a", "b", "c" };
|
||||
|
||||
public static void main(final String ... args){
|
||||
if (args.length == 1){
|
||||
for(int i = 0; i < strings.length; i++)
|
||||
new Thread(){
|
||||
public void run(){
|
||||
new String(strings[<caret>i]);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user