From da08bce211ee200f5e50859e9eadbb9ac19f4869 Mon Sep 17 00:00:00 2001 From: yeom Date: Tue, 12 Jul 2011 22:14:10 +0000 Subject: [PATCH] bug fix: if a parent class doesn't define lattice, we don't need to check whether its child classes define lattice --- Robust/src/Analysis/SSJava/FlowDownCheck.java | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Robust/src/Analysis/SSJava/FlowDownCheck.java b/Robust/src/Analysis/SSJava/FlowDownCheck.java index 108ad0dc..c108946b 100644 --- a/Robust/src/Analysis/SSJava/FlowDownCheck.java +++ b/Robust/src/Analysis/SSJava/FlowDownCheck.java @@ -148,23 +148,29 @@ public class FlowDownCheck { SSJavaLattice superLattice = ssjava.getClassLattice(superCd); SSJavaLattice subLattice = ssjava.getClassLattice(cd); - if (superLattice != null && subLattice == null) { - throw new Error("If a parent class '" + superCd + "' has a ordering lattice, its subclass '" - + cd + "' should have one."); - } + if (superLattice != null) { + + if (subLattice == null) { + throw new Error("If a parent class '" + superCd + + "' has a ordering lattice, its subclass '" + cd + "' should have one."); + } - Set> superPairSet = superLattice.getOrderingPairSet(); - Set> subPairSet = subLattice.getOrderingPairSet(); + Set> superPairSet = superLattice.getOrderingPairSet(); + Set> subPairSet = subLattice.getOrderingPairSet(); - for (Iterator iterator = superPairSet.iterator(); iterator.hasNext();) { - Pair pair = (Pair) iterator.next(); + for (Iterator iterator = superPairSet.iterator(); iterator.hasNext();) { + Pair pair = (Pair) iterator.next(); - if (!subPairSet.contains(pair)) { - throw new Error("Subclass '" + cd + "' does not have the relative ordering '" - + pair.getSecond() + " < " + pair.getFirst() + "' that is defined by its superclass '" - + superCd + "'."); + if (!subPairSet.contains(pair)) { + throw new Error("Subclass '" + cd + "' does not have the relative ordering '" + + pair.getSecond() + " < " + pair.getFirst() + + "' that is defined by its superclass '" + superCd + "'."); + } } + } + // if super class doesn't define lattice, then we don't need to check its + // subclass } -- 2.34.1