KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > testdata > bugs > IfStatementAndOrExpression


1 package testdata.bugs;
2
3 /**
4  * Bytecode Optimizing Buggy at or expression in if statement
5  * @version $Id: IfStatementAndOrExpression.java,v 1.2 2003/01/28 17:30:53 hchacha Exp $
6  * @author Hidetoshi Ohuchi <hchacha@users.sourceforge.net>
7  */

8 public class IfStatementAndOrExpression {
9     public IfStatementAndOrExpression() {
10     }
11     
12     private StringBuffer JavaDoc currentData;
13     private boolean b1,b2,b3;
14     
15     public void method1(int c, boolean flag) {
16         if (b1 || b2) {
17             if (c == '\r' || c == '\n' || c == '\t' || c == ' ') {
18                 return;
19             }
20             currentData.append((char)c);
21             return;
22         }
23         if (!b3) {
24             if (c == '\r' || c == '\n' || c == '\t') {
25                 c = ' ';
26             }
27         } else {
28             if (c == '\r') {
29                 return;
30             } else if (c == '\r') {
31                 return;
32             } else if (c == '\t') {
33                 c = ' ';
34             }
35         }
36         return;
37     }
38 }
39
Popular Tags