IDEA-57396
authorAlexey Kudravtsev <cdr@intellij.com>
Fri, 13 Aug 2010 08:06:16 +0000 (12:06 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Fri, 13 Aug 2010 08:09:42 +0000 (12:09 +0400)
java/java-tests/testSrc/com/intellij/codeInsight/slice/SliceTreeTest.java
java/java-tests/testSrc/com/intellij/dependencies/UsagesInAnalyzingDependenciesTest.java
platform/usageView/src/com/intellij/usages/ChunkExtractor.java

index 279352dd80fa84f0fad1fa8bbaf9c0c3a8968548..7ae7027878297b7b3fa68246752d9f3c5cf23678 100644 (file)
@@ -25,7 +25,7 @@ import java.util.*;
  */
 public class SliceTreeTest extends LightDaemonAnalyzerTestCase {
   @Override protected Sdk getProjectJDK() {
-    return JavaSdkImpl.getMockJdk17("java 1.5");
+    return JavaSdkImpl.getMockJdk17();
   }
 
   private SliceTreeStructure configureTree(@NonNls final String name) throws Exception {
@@ -185,69 +185,69 @@ public class SliceTreeTest extends LightDaemonAnalyzerTestCase {
 
     checkStructure(newRoot, "Null Values\n" +
                             "  Value: o\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (15, 13) |set|(|o|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (15: 13) |set|(|o|)|;\n" +
                             "  Value: nu()\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (29, 13) |set|(|nu|(|)|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (29: 13) |set|(|nu|(|)|)|;\n" +
                             "  Value: t\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (46, 15) |x|.|set|(|t|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (46: 15) |x|.|set|(|t|)|;\n" +
                             "NotNull Values\n" +
                             "  Value: \"\"\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (19, 13) |set|(|CON|)|;\n" +
-                            "          (5, 39) |private| |final| |static| |String| |CON| |=| |\"\"|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (19: 13) |set|(|CON|)|;\n" +
+                            "          (5: 39) |private| |final| |static| |String| |CON| |=| |\"\"|;\n" +
                             "  Value: \"xxx\"\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (10, 13) |set|(|\"xxx\"|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (10: 13) |set|(|\"xxx\"|)|;\n" +
                             "  Value: new String()\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (17, 13) |set|(|new| |String|(|)|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (17: 13) |set|(|new| |String|(|)|)|;\n" +
                             "  Value: nn()\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (18, 13) |set|(|nn|(|)|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (18: 13) |set|(|nn|(|)|)|;\n" +
                             "  Value: nn\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (21, 13) |set|(|nn|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (21: 13) |set|(|nn|)|;\n" +
                             "  Value: g\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (27, 13) |set|(|g|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (27: 13) |set|(|g|)|;\n" +
                             "  Value: \"null\"\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (48, 15) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
-                            "          (48, 27) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (48: 15) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
+                            "          (48: 27) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
                             "  Value: t\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (48, 15) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
-                            "          (48, 36) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (48: 15) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
+                            "          (48: 36) |x|.|set|(|t| |==| |null| |?| |\"null\"| |:| |t|)|;\n" +
                             "  Value: d\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (55, 13) |l| |=| |d|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (55: 13) |l| |=| |d|;\n" +
                             "Other Values\n" +
                             "  Value: g\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (11, 13) |set|(|g|)|;\n" +
-                            "        (24, 13) |set|(|other|)|;\n" +
-                            "          (23, 24) |String| |other| |=| |g| |==| |\"\"| |?| |CON| |:| |g|;\n" +
-                            "            (23, 40) |String| |other| |=| |g| |==| |\"\"| |?| |CON| |:| |g|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (11: 13) |set|(|g|)|;\n" +
+                            "        (24: 13) |set|(|other|)|;\n" +
+                            "          (23: 24) |String| |other| |=| |g| |==| |\"\"| |?| |CON| |:| |g|;\n" +
+                            "            (23: 40) |String| |other| |=| |g| |==| |\"\"| |?| |CON| |:| |g|;\n" +
                             "  Value: d\n" +
-                            "    (6, 12) |String| |l|;\n" +
-                            "      (52, 13) |l| |=| |d|;\n" +
-                            "        (30, 13) |set|(|hz|(|)|)|;\n" +
-                            "          (42, 16) |return| |d|;\n" +
+                            "    (6: 12) |String| |l|;\n" +
+                            "      (52: 13) |l| |=| |d|;\n" +
+                            "        (30: 13) |set|(|hz|(|)|)|;\n" +
+                            "          (42: 16) |return| |d|;\n" +
                             "");
   }
 
@@ -297,9 +297,9 @@ public class SliceTreeTest extends LightDaemonAnalyzerTestCase {
     checkStructure(newRoot,
         "Null Values\n" +
         "  Value: null\n" +
-        "    (2, 10) |String| |l|;\n" +
-        "      (4, 9) |l| |=| |null|;\n" +
-        "      (7, 9) |l| |=| |null|;\n" +
+        "    (2: 10) |String| |l|;\n" +
+        "      (4: 9) |l| |=| |null|;\n" +
+        "      (7: 9) |l| |=| |null|;\n" +
         ""
                    );
   }
index 8c42f1029bd6b6b3940e7a385a4cf5c6f651686c..2c4ac6c08cdcd471581fe29cb7c1a0e2804fb05a 100644 (file)
@@ -65,8 +65,16 @@ public class UsagesInAnalyzingDependenciesTest extends PsiTestCase{
     for (int i = 0; i < usagesInfos.length; i++) {
       psiUsages[i] = toString(usages[i]);
     }
-    checkResult(new String []{"(2, 14) import com.a.A;","(4, 3) A myA = new A();", "(4, 15) A myA = new A();", "(6, 9) myA.aa();",
-                              "(2, 14) import com.a.A;","(4, 3) A myA = new A();", "(4, 15) A myA = new A();", "(6, 9) myA.aa();"}, psiUsages);
+    checkResult(new String []{
+      "(2: 14) import com.a.A;",
+      "(4: 3) A myA = new A();",
+      "(4: 15) A myA = new A();",
+      "(6: 9) myA.aa();",
+
+      "(2: 14) import com.a.A;",
+      "(4: 3) A myA = new A();",
+      "(4: 15) A myA = new A();",
+      "(6: 9) myA.aa();"}, psiUsages);
   }
 
   private static String toString(Usage usage) {
@@ -96,7 +104,7 @@ public class UsagesInAnalyzingDependenciesTest extends PsiTestCase{
     for (int i = 0; i < usagesInfos.length; i++) {
       psiUsages[i] = toString(usages[i]);
     }
-    checkResult(new String []{"(4, 3) A myA = new A();", "(4, 15) A myA = new A();", "(5, 3) C myC = new C();", "(5, 15) C myC = new C();", "(7, 9) myA.aa();", "(8, 9) myC.cc();"}, psiUsages);
+    checkResult(new String []{"(4: 3) A myA = new A();", "(4: 15) A myA = new A();", "(5: 3) C myC = new C();", "(5: 15) C myC = new C();", "(7: 9) myA.aa();", "(8: 9) myC.cc();"}, psiUsages);
   }
 
   public void testForwardSimple(){
@@ -116,7 +124,7 @@ public class UsagesInAnalyzingDependenciesTest extends PsiTestCase{
     for (int i = 0; i < usagesInfos.length; i++) {
       psiUsages[i] = toString(usages[i]);
     }
-    checkResult(new String []{"(2, 3) B myB = new B();", "(2, 15) B myB = new B();", "(4, 9) myB.bb();"}, psiUsages);
+    checkResult(new String []{"(2: 3) B myB = new B();", "(2: 15) B myB = new B();", "(4: 9) myB.bb();"}, psiUsages);
   }
 
   private static void checkResult(final String[] usages, final String [] psiUsages) {
index e7df19e8c17bd2aa54decbdd4e4632b027a63e0b..8f8a06937d45d585c987111f8b1746918667e054 100644 (file)
@@ -56,7 +56,7 @@ public class ChunkExtractor {
 
   private final Lexer myLexer;
 
-  private static abstract class WeakFactory<T> {
+  private abstract static class WeakFactory<T> {
 
     private WeakReference<T> myRef;
 
@@ -246,7 +246,7 @@ public class ChunkExtractor {
   private void appendPrefix(List<TextChunk> result, int lineNumber, int columnNumber) {
     StringBuilder buffer = new StringBuilder("(");
     buffer.append(lineNumber + 1);
-    buffer.append(", ");
+    buffer.append(": ");
     buffer.append(columnNumber + 1);
     buffer.append(") ");
     TextChunk prefixChunk = new TextChunk(myColorsScheme.getAttributes(UsageTreeColors.USAGE_LOCATION), buffer.toString());