Author: [email protected]
Date: Mon Mar  9 15:56:44 2009
New Revision: 4962

Modified:
    releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java

Log:
Pulling JSNI ref resolution checking.  There are currently too many cases  
we get wrong, which generates spurious warnings.

TODO: reenable when we catch all the cases.

Review by: bruce


Modified:  
releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java
==============================================================================
--- releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java  
(original)
+++ releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java Mon  
Mar  9 15:56:44 2009
@@ -157,10 +157,16 @@
                errors.put(jsniRefString, refErrors);
              }
            } else if (!jsniRef.className().equals("null")) {
-            GWTProblem.recordInCud(ProblemSeverities.Warning, meth, cud,
-                "Referencing class '" + jsniRef.className()
-                    + ": unable to resolve class, expect subsequent  
failures",
-                null);
+            /*
+             * TODO(scottb): re-enable this when we no longer get a bunch  
of
+             * false failures. Currently we can't resolve top level types  
(like
+             * boolean_Array_Rank_1_FieldSerializer), and we also don't  
resolve
+             * array and primitive refs, like @Z[]::class.
+             */
+            // GWTProblem.recordInCud(ProblemSeverities.Warning, meth, cud,
+            // "Referencing class '" + jsniRef.className()
+            // + ": unable to resolve class, expect subsequent failures",
+            // null);
            }
          }
        }
@@ -203,6 +209,21 @@
        char[][] compoundName = getCompoundName(jsniRef);
        TypeBinding binding = cud.scope.getType(compoundName,  
compoundName.length);

+      /*
+       * TODO(scottb): we cannot currently resolve top-level types; here's  
some
+       * experimental code that will let us do this.
+       */
+      // ReferenceBinding binding = cud.scope.environment().askForType(
+      // compoundName);
+      // while (binding == null && compoundName.length > 1) {
+      // int newLen = compoundName.length - 1;
+      // char[][] next = new char[newLen][];
+      // System.arraycopy(compoundName, 0, next, 0, newLen - 1);
+      // next[newLen - 1] = CharOperation.concat(compoundName[newLen - 1],
+      // compoundName[newLen], '$');
+      // compoundName = next;
+      // binding = cud.scope.environment().askForType(compoundName);
+      // }
        if (binding instanceof ProblemReferenceBinding) {
          ProblemReferenceBinding prb = (ProblemReferenceBinding) binding;
          if (prb.problemId() == ProblemReasons.NotVisible) {

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to