View Javadoc

    1   package net.sourceforge.pmd.typeresolution.testdata;
    2
    3   import java.util.List;
    4
    5   public class Operators {
    6   	public void unaryLogicalOperators() {
    7   		boolean t;
    8   		t = !true;
    9   		t = !false;
    10  	}
    11  	public void binaryLogicalOperators() {
    12  		boolean t;
    13  		t = true | false;
    14  		t = true & false;
    15  		t = true ^ false;
    16  		t = true && false;
    17  		t = true || false;
    18  		t = 1 > 1;
    19  		t = 1 >= 1;
    20  		t = 1 == 1;
    21  		t = 1 != 1;
    22  		t = 1 <= 1;
    23  		t = 1 < 1;
    24  		t = this instanceof List;
    25  		t = this instanceof Operators;
    26  	}
    27  	public void unaryNumericOperators() {
    28  		double t;
    29  		t = +1;
    30  		t = -1;
    31  		t++;
    32  		t--;
    33  		++t;
    34  		--t;
    35  	}
    36  	public void binaryNumericOperators() {
    37  		long t;
    38  		t = 1 + 1;
    39  		t = 1 - 1;
    40  		t = 1 / 1;
    41  		t = 1 * 1;
    42  		t = 1 % 1;
    43  		t = 1 << 1;
    44  		t = 1 >> 1;
    45  		t = 1 >>> 1;
    46  	}
    47  	public void assignmentOperators() {
    48  		long t;
    49  		t = 1;
    50  		t *= 1;
    51  		t /= 1;
    52  		t %= 1;
    53  		t += 1;
    54  		t -= 1;
    55  		t <<= 1;
    56  		t >>= 1;
    57  		t >>>= 1;
    58  		t &= 1;
    59  		t ^= 1;
    60  		t |= 1;
    61  	}
    62  }