01: package testlib;
02:
03: import java.io.IOException;
04:
05: public class MethodsChange {
06: private int priv;
07:
08: public MethodsChange() {
09: priv = 2;
10: }
11:
12: protected MethodsChange(int initialpriv, boolean newArg) {
13: priv = initialpriv;
14: }
15:
16: protected MethodsChange(Integer initialpriv) {
17: priv = initialpriv.intValue();
18: }
19:
20: public int getPriv() {
21: return priv;
22: }
23:
24: private int getPriv2() {
25: return priv;
26: }
27:
28: public Integer getPrivAsNumber() {
29: return new Integer(priv);
30: }
31:
32: public Number getPrivAsInteger() {
33: return new Integer(priv);
34: }
35:
36: public Long getPrivSquare() {
37: return new Long(priv * priv);
38: }
39:
40: public void printPriv(String prefix) {
41: System.out.println(prefix + priv);
42: }
43:
44: public void weakenParamType(Object s) {
45: }
46:
47: public void strengthenParamType(String s) {
48: }
49:
50: public void changeParamType(Integer x) {
51: }
52:
53: public void throwIOException() throws Exception {
54: throw new java.io.IOException();
55: }
56:
57: public void throwException() throws IOException {
58: throw new java.io.IOException();
59: }
60:
61: public void throwException2() {
62: }
63:
64: public void throwRuntimeException() {
65: throw new RuntimeException();
66: }
67:
68: public void throwNoRuntimeException() throws RuntimeException {
69: throw new RuntimeException();
70: }
71:
72: public void throwNoException() throws Exception {
73: throw new Exception();
74: }
75:
76: /**
77: * @deprecated this is a bad method.
78: */
79: public void becomesDeprecated() {
80: }
81:
82: /**
83: * This method was previously deprecated.
84: */
85: public void becomesUndeprecated() {
86: }
87:
88: public void becomesNonFinal() {
89: }
90:
91: public final void becomesFinal() {
92: }
93:
94: }
|