KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > ba > npe2 > AcmpCondition


1 /*
2  * FindBugs - Find Bugs in Java programs
3  * Copyright (C) 2006, University of Maryland
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package edu.umd.cs.findbugs.ba.npe2;
21
22 import org.apache.bcel.Constants;
23
24 import edu.umd.cs.findbugs.ba.DataflowAnalysisException;
25 import edu.umd.cs.findbugs.ba.Edge;
26 import edu.umd.cs.findbugs.ba.Location;
27 import edu.umd.cs.findbugs.ba.vna.ValueNumber;
28 import edu.umd.cs.findbugs.ba.vna.ValueNumberFrame;
29
30 /**
31  * @author David Hovemeyer
32  */

33 public class AcmpCondition extends Condition {
34     private Decision ifcmpDecision;
35     private Decision fallThroughDecision;
36     
37     public AcmpCondition(Location location) {
38         super(location);
39     }
40
41     /* (non-Javadoc)
42      * @see edu.umd.cs.findbugs.ba.npe2.Condition#getDecision(edu.umd.cs.findbugs.ba.Edge)
43      */

44     @Override JavaDoc
45     public Decision getDecision(Edge edge) {
46         // TODO Auto-generated method stub
47
return null;
48     }
49
50     /* (non-Javadoc)
51      * @see edu.umd.cs.findbugs.ba.npe2.Condition#getValueNumber()
52      */

53     @Override JavaDoc
54     public ValueNumber getValueNumber() {
55         // TODO Auto-generated method stub
56
return null;
57     }
58
59     /* (non-Javadoc)
60      * @see edu.umd.cs.findbugs.ba.npe2.Condition#refresh(edu.umd.cs.findbugs.ba.vna.ValueNumberFrame, edu.umd.cs.findbugs.ba.npe2.DefinitelyNullSet)
61      */

62     @Override JavaDoc
63     public void refresh(ValueNumberFrame vnaFrame, DefinitelyNullSet definitelyNullSet) throws DataflowAnalysisException {
64         
65 // // Get top two stack values
66
// ValueNumber a = vnaFrame.getStackValue(0);
67
// ValueNumber b = vnaFrame.getStackValue(1);
68
//
69
// boolean acmpEqOpcode =
70
// getLocation().getHandle().getInstruction().getOpcode() == Constants.IF_ACMPEQ;
71
//
72
// if (a.equals(b)
73
// || (definitelyNullSet.isValueNull(a) && definitelyNullSet.isValueNull(b))) {
74
// // Definitely the same value.
75
// // We don't learn anything about the nullness,
76
// // but one of the edges of the branch is
77
// // infeasible.
78
//
79
// ifcmpDecision = new Decision(
80
// acmpEqOpcode,
81
// false,
82
// false
83
// );
84
//
85
// fallThroughDecision = new Decision(
86
// !acmpEqOpcode,
87
// false,
88
// false
89
// );
90
//
91
// return;
92
// }
93

94         
95     }
96
97
98 }
99
Popular Tags