IDEA-130708 Incorrect locals names

This commit is contained in:
Egor.Ushakov
2017-01-12 15:03:43 +03:00
parent 6a09fe2524
commit 5e45e5ac40
15 changed files with 296 additions and 75 deletions

View File

@@ -11,9 +11,9 @@ public class Loader {
throw new RuntimeException("Resource missing");
} else {
try {
File e = new File(resource.toURI());
byte[] bytes = new byte[(int)e.length()];
FileInputStream stream = new FileInputStream(e);
File file = new File(resource.toURI());
byte[] bytes = new byte[(int)file.length()];
FileInputStream stream = new FileInputStream(file);
stream.read(bytes);
stream.close();
return new String(bytes, "UTF-8");

Binary file not shown.

View File

@@ -11,7 +11,7 @@ class TestAmbiguousCall {
IllegalArgumentException iae = new IllegalArgumentException();// 8
this.m1((RuntimeException)iae, "RE");// 9
this.m1(iae, "IAE");// 10
IllegalArgumentException re = new IllegalArgumentException();// 12
RuntimeException re = new IllegalArgumentException();// 12
this.m1((RuntimeException)re, "RE");// 13
this.m1((IllegalArgumentException)re, "IAE");// 14
}// 15

View File

@@ -0,0 +1,77 @@
package pkg;
import java.io.File;
public class TestLocalsNames {
private static void rename(File file, boolean recursively) {
if(file.isDirectory()) {// 22
long start = System.currentTimeMillis();// 23
File[] files = file.listFiles();// 25
File[] var5 = files;
int var6 = files.length;
for(int var7 = 0; var7 < var6; ++var7) {// 26
File s = var5[var7];
File dest = new File(s.getAbsolutePath() + ".tmp");// 27
assert s.renameTo(dest) : "unable to rename " + s + " to " + dest;// 28
}
long elapsed = System.currentTimeMillis() - start;// 31
System.out.println("took " + elapsed + "ms (" + elapsed / (long)files.length + "ms per dir)");// 32
}
}// 34
}
class 'pkg/TestLocalsNames' {
method 'rename (Ljava/io/File;Z)V' {
1 6
4 6
7 7
a 7
c 8
f 8
13 9
17 10
18 10
1a 12
1b 12
21 12
28 13
29 13
38 14
3e 14
43 14
49 14
55 16
66 16
70 16
7a 16
81 12
87 19
8b 19
8c 19
8e 20
98 20
a2 20
ab 20
ac 20
ad 20
b1 20
b6 20
b9 20
bc 23
}
}
Lines mapping:
22 <-> 7
23 <-> 8
25 <-> 9
26 <-> 13
27 <-> 15
28 <-> 17
31 <-> 20
32 <-> 21
34 <-> 24

View File

@@ -0,0 +1,35 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package pkg;
import java.io.File;
public class TestLocalsNames {
private static void rename(File file, boolean recursively) {
if (file.isDirectory()) {
long start = System.currentTimeMillis();
File[] files = file.listFiles();
for (File s : files) {
File dest = new File(s.getAbsolutePath() + ".tmp");
assert s.renameTo(dest) : "unable to rename " + s + " to " + dest;
}
long elapsed = System.currentTimeMillis() - start;
System.out.println("took " + elapsed + "ms (" + elapsed / files.length + "ms per dir)");
}
}
}