下面列出了java.util.Stack#addElement ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public void concreteWriteReadStackNegativeTest() {
String tainted = TelephonyManager.getDeviceId();
Stack<String> stack = new Stack<String>();
Stack<String> stack2 = new Stack<String>();
stack.addElement("neutral");
stack2.push(tainted);
stack2.add(tainted);
String untaintedElement = stack.get(0);
String taintedElement = stack2.peek();
taintedElement = stack2.pop();
taintedElement = stack2.get(0);
taintedElement.toString();
ConnectionManager cm = new ConnectionManager();
cm.publish(untaintedElement);
}
public void concreteWriteReadStackGetTest() {
String tainted = TelephonyManager.getDeviceId();
Stack<String> stack = new Stack<String>();
stack.addElement("neutral");
stack.push(tainted);
String taintedElement2 = stack.get(0);
ConnectionManager cm = new ConnectionManager();
cm.publish(taintedElement2);
}
public void concreteWriteReadStackPeekTest() {
String tainted = TelephonyManager.getDeviceId();
Stack<String> stack = new Stack<String>();
stack.addElement("neutral");
stack.push(tainted);
String taintedElement = stack.peek();
ConnectionManager cm = new ConnectionManager();
cm.publish(taintedElement);
}
public void concreteWriteReadStackPopTest() {
String tainted = TelephonyManager.getDeviceId();
Stack<String> stack = new Stack<String>();
stack.addElement("neutral");
stack.push(tainted);
String taintedElement3 = stack.pop();
ConnectionManager cm = new ConnectionManager();
cm.publish(taintedElement3);
}