Skip to content

Commit dd17a2d

Browse files
author
Rory Winston
committed
Some more FindBugs improvements
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH@489067 13f79535-47bb-0310-9956-ffa450edef68
1 parent e5fe8fe commit dd17a2d

File tree

3 files changed

+49
-50
lines changed

3 files changed

+49
-50
lines changed

src/main/java/org/apache/commons/net/ntp/TimeInfo.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class TimeInfo {
3030

3131
private NtpV3Packet _message;
32-
private List _comments;
32+
private List<String> _comments;
3333
private Long _delay;
3434
private Long _offset;
3535

@@ -117,7 +117,7 @@ public TimeInfo(NtpV3Packet message, long returnTime, List comments,
117117
public void addComment(String comment)
118118
{
119119
if (_comments == null) {
120-
_comments = new ArrayList();
120+
_comments = new ArrayList<String>();
121121
}
122122
_comments.add(comment);
123123
}
@@ -133,7 +133,7 @@ public void computeDetails()
133133
}
134134
_detailsComputed = true;
135135
if (_comments == null) {
136-
_comments = new ArrayList();
136+
_comments = new ArrayList<String>();
137137
}
138138

139139
TimeStamp origNtpTime = _message.getOriginateTimeStamp();
@@ -169,7 +169,7 @@ public void computeDetails()
169169
// might be via a broadcast NTP packet...
170170
if (xmitNtpTime.ntpValue() != 0)
171171
{
172-
_offset = new Long(xmitTime - _returnTime);
172+
_offset = Long.valueOf(xmitTime - _returnTime);
173173
_comments.add("Error: zero orig time -- cannot compute delay");
174174
} else
175175
_comments.add("Error: zero orig time -- cannot compute delay/offset");
@@ -183,7 +183,7 @@ public void computeDetails()
183183
{
184184
// without receive or xmit time cannot figure out processing time
185185
// so delay is simply the network travel time
186-
_delay = new Long(_returnTime - origTime);
186+
_delay = Long.valueOf(_returnTime - origTime);
187187
}
188188
// TODO: is offset still valid if rcvNtpTime=0 || xmitNtpTime=0 ???
189189
// Could always hash origNtpTime (sendTime) but if host doesn't set it
@@ -192,11 +192,11 @@ public void computeDetails()
192192
if (rcvNtpTime.ntpValue() != 0)
193193
{
194194
// xmitTime is 0 just use rcv time
195-
_offset = new Long(rcvTime - origTime);
195+
_offset = Long.valueOf(rcvTime - origTime);
196196
} else if (xmitNtpTime.ntpValue() != 0)
197197
{
198198
// rcvTime is 0 just use xmitTime time
199-
_offset = new Long(xmitTime - _returnTime);
199+
_offset = Long.valueOf(xmitTime - _returnTime);
200200
}
201201
} else
202202
{
@@ -231,11 +231,11 @@ public void computeDetails()
231231
_comments.add("Warning: processing time > total network time");
232232
}
233233
}
234-
_delay = new Long(delayValue);
234+
_delay = Long.valueOf(delayValue);
235235
if (origTime > _returnTime) // assert destTime >= origTime
236236
_comments.add("Error: OrigTime > DestRcvTime");
237237

238-
_offset = new Long(((rcvTime - origTime) + (xmitTime - _returnTime)) / 2);
238+
_offset = Long.valueOf(((rcvTime - origTime) + (xmitTime - _returnTime)) / 2);
239239
}
240240
}
241241

src/main/java/org/apache/commons/net/telnet/TelnetOption.java

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,87 +32,87 @@ public class TelnetOption
3232
/*** The maximum value an option code can have. This value is 255. ***/
3333
public static final int MAX_OPTION_VALUE = 255;
3434

35-
public static int BINARY = 0;
35+
public static final int BINARY = 0;
3636

37-
public static int ECHO = 1;
37+
public static final int ECHO = 1;
3838

39-
public static int PREPARE_TO_RECONNECT = 2;
39+
public static final int PREPARE_TO_RECONNECT = 2;
4040

41-
public static int SUPPRESS_GO_AHEAD = 3;
41+
public static final int SUPPRESS_GO_AHEAD = 3;
4242

43-
public static int APPROXIMATE_MESSAGE_SIZE = 4;
43+
public static final int APPROXIMATE_MESSAGE_SIZE = 4;
4444

45-
public static int STATUS = 5;
45+
public static final int STATUS = 5;
4646

47-
public static int TIMING_MARK = 6;
47+
public static final int TIMING_MARK = 6;
4848

49-
public static int REMOTE_CONTROLLED_TRANSMISSION = 7;
49+
public static final int REMOTE_CONTROLLED_TRANSMISSION = 7;
5050

51-
public static int NEGOTIATE_OUTPUT_LINE_WIDTH = 8;
51+
public static final int NEGOTIATE_OUTPUT_LINE_WIDTH = 8;
5252

53-
public static int NEGOTIATE_OUTPUT_PAGE_SIZE = 9;
53+
public static final int NEGOTIATE_OUTPUT_PAGE_SIZE = 9;
5454

55-
public static int NEGOTIATE_CARRIAGE_RETURN = 10;
55+
public static final int NEGOTIATE_CARRIAGE_RETURN = 10;
5656

57-
public static int NEGOTIATE_HORIZONTAL_TAB_STOP = 11;
57+
public static final int NEGOTIATE_HORIZONTAL_TAB_STOP = 11;
5858

59-
public static int NEGOTIATE_HORIZONTAL_TAB = 12;
59+
public static final int NEGOTIATE_HORIZONTAL_TAB = 12;
6060

61-
public static int NEGOTIATE_FORMFEED = 13;
61+
public static final int NEGOTIATE_FORMFEED = 13;
6262

63-
public static int NEGOTIATE_VERTICAL_TAB_STOP = 14;
63+
public static final int NEGOTIATE_VERTICAL_TAB_STOP = 14;
6464

65-
public static int NEGOTIATE_VERTICAL_TAB = 15;
65+
public static final int NEGOTIATE_VERTICAL_TAB = 15;
6666

67-
public static int NEGOTIATE_LINEFEED = 16;
67+
public static final int NEGOTIATE_LINEFEED = 16;
6868

69-
public static int EXTENDED_ASCII = 17;
69+
public static final int EXTENDED_ASCII = 17;
7070

71-
public static int FORCE_LOGOUT = 18;
71+
public static final int FORCE_LOGOUT = 18;
7272

73-
public static int BYTE_MACRO = 19;
73+
public static final int BYTE_MACRO = 19;
7474

75-
public static int DATA_ENTRY_TERMINAL = 20;
75+
public static final int DATA_ENTRY_TERMINAL = 20;
7676

77-
public static int SUPDUP = 21;
77+
public static final int SUPDUP = 21;
7878

79-
public static int SUPDUP_OUTPUT = 22;
79+
public static final int SUPDUP_OUTPUT = 22;
8080

81-
public static int SEND_LOCATION = 23;
81+
public static final int SEND_LOCATION = 23;
8282

83-
public static int TERMINAL_TYPE = 24;
83+
public static final int TERMINAL_TYPE = 24;
8484

85-
public static int END_OF_RECORD = 25;
85+
public static final int END_OF_RECORD = 25;
8686

8787
public static int TACACS_USER_IDENTIFICATION = 26;
8888

89-
public static int OUTPUT_MARKING = 27;
89+
public static final int OUTPUT_MARKING = 27;
9090

91-
public static int TERMINAL_LOCATION_NUMBER = 28;
91+
public static final int TERMINAL_LOCATION_NUMBER = 28;
9292

93-
public static int REGIME_3270 = 29;
93+
public static final int REGIME_3270 = 29;
9494

95-
public static int X3_PAD = 30;
95+
public static final int X3_PAD = 30;
9696

97-
public static int WINDOW_SIZE = 31;
97+
public static final int WINDOW_SIZE = 31;
9898

99-
public static int TERMINAL_SPEED = 32;
99+
public static final int TERMINAL_SPEED = 32;
100100

101-
public static int REMOTE_FLOW_CONTROL = 33;
101+
public static final int REMOTE_FLOW_CONTROL = 33;
102102

103-
public static int LINEMODE = 34;
103+
public static final int LINEMODE = 34;
104104

105-
public static int X_DISPLAY_LOCATION = 35;
105+
public static final int X_DISPLAY_LOCATION = 35;
106106

107-
public static int OLD_ENVIRONMENT_VARIABLES = 36;
107+
public static final int OLD_ENVIRONMENT_VARIABLES = 36;
108108

109-
public static int AUTHENTICATION = 37;
109+
public static final int AUTHENTICATION = 37;
110110

111-
public static int ENCRYPTION = 38;
111+
public static final int ENCRYPTION = 38;
112112

113-
public static int NEW_ENVIRONMENT_VARIABLES = 39;
113+
public static final int NEW_ENVIRONMENT_VARIABLES = 39;
114114

115-
public static int EXTENDED_OPTIONS_LIST = 255;
115+
public static final int EXTENDED_OPTIONS_LIST = 255;
116116

117117
private static int __FIRST_OPTION = BINARY;
118118
private static int __LAST_OPTION = EXTENDED_OPTIONS_LIST;

src/site/site.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<item name="Release Notes" href="/changes-report.html"/>
2525
</menu>
2626
<menu name="Development">
27-
<item name="To-Do List" href="/tasks.html"/>
2827
<item name="Coding Specifications" href="/code-standards.html"/>
2928
</menu>
3029

0 commit comments

Comments
 (0)