changes: mainly fixed problems of a tertiary node, pc loc checking, flow edges of...
[IRC.git] / Robust / src / Analysis / SSJava / MethodAnnotationCheck.java
index 5dbcc8ad89b324218b0a3837bd8a3ab33ba1bda2..9ed0123f3bf71c9e0e6358c146fb30ab3b321fb9 100644 (file)
@@ -64,7 +64,7 @@ public class MethodAnnotationCheck {
       ClassDescriptor cd = (ClassDescriptor) obj;
       toanalyze.remove(cd);
 
-      if (!cd.isInterface()) {
+      if (!ssjava.isSSJavaUtil(cd) && !cd.isInterface()) {
         for (Iterator method_it = cd.getMethods(); method_it.hasNext();) {
           MethodDescriptor md = (MethodDescriptor) method_it.next();
           checkTrustworthyMethodAnnotation(md);
@@ -76,7 +76,9 @@ public class MethodAnnotationCheck {
 
     for (Iterator iterator = annotatedMDSet.iterator(); iterator.hasNext();) {
       MethodDescriptor md = (MethodDescriptor) iterator.next();
-      ssjava.addAnnotationRequire(md);
+      if (!ssjava.isTrustMethod(md)) {
+        ssjava.addAnnotationRequire(md);
+      }
     }
 
     Set<Pair> visited = new HashSet<Pair>();
@@ -95,7 +97,7 @@ public class MethodAnnotationCheck {
           if (!visited.contains(p)) {
             visited.add(p);
 
-            if (!ssjava.isTrustMethod(calleeMD)) {
+            if (!ssjava.isTrustMethod(callerMD) && !ssjava.isTrustMethod(calleeMD)) {
               // if method is annotated as "TRUST", do not need to check for
               // linear type & flow-down rule
               tovisit.add(calleeMD);
@@ -282,6 +284,7 @@ public class MethodAnnotationCheck {
       if (isSSJavaLoop) {
         throw new Error("Only outermost loop can be the self-stabilizing loop.");
       } else {
+        ssjava.setMethodContainingSSJavaLoop(md);
         annotatedMDSet.add(md);
         isSSJavaLoop = true;
       }