@Override
 public BasicValue merge(final BasicValue v, final BasicValue w) {
   if (!v.equals(w)) {
     return BasicValue.UNINITIALIZED_VALUE;
   }
   return v;
 }
Exemple #2
0
 @Override
 public BasicValue merge(final BasicValue v, final BasicValue w) {
   if (!v.equals(w)) {
     Type t = v.getType();
     Type u = w.getType();
     if (t != null && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY)) {
       if (u != null && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY)) {
         if ("Lnull;".equals(t.getDescriptor())) {
           return w;
         }
         if ("Lnull;".equals(u.getDescriptor())) {
           return v;
         }
         if (isAssignableFrom(t, u)) {
           return v;
         }
         if (isAssignableFrom(u, t)) {
           return w;
         }
         // TODO case of array classes of the same dimension
         // TODO should we look also for a common super interface?
         // problem: there may be several possible common super
         // interfaces
         do {
           if (t == null || isInterface(t)) {
             return BasicValue.REFERENCE_VALUE;
           }
           t = getSuperClass(t);
           if (isAssignableFrom(t, u)) {
             return newValue(t);
           }
         } while (true);
       }
     }
     return BasicValue.UNINITIALIZED_VALUE;
   }
   return v;
 }