Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Yuta HIGUCHI
2014-10-23 09:49:00 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e5ca93bf1f4cc1add802362ebbc7eb0516aee5d1
e5ca93bf
1 parent
692ca59a
fix some of findbugs issues
Change-Id: I20aa54af16f3a1e3323d735fe53cc26c03d5e52e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
14 deletions
core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleHostStore.java
utils/misc/src/main/java/org/onlab/packet/ChassisId.java
utils/misc/src/main/java/org/onlab/packet/DHCP.java
utils/misc/src/main/java/org/onlab/packet/IPv4.java
utils/misc/src/main/java/org/onlab/util/HexString.java
utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
View file @
e5ca93b
...
...
@@ -399,7 +399,7 @@ public class GossipHostStore
}
// Auxiliary extension to allow location to mutate.
private
class
StoredHost
extends
DefaultHost
{
private
static
final
class
StoredHost
extends
DefaultHost
{
private
Timestamped
<
HostLocation
>
location
;
/**
...
...
core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleHostStore.java
View file @
e5ca93b
...
...
@@ -269,7 +269,7 @@ public class SimpleHostStore
}
// Auxiliary extension to allow location to mutate.
private
class
StoredHost
extends
DefaultHost
{
private
static
final
class
StoredHost
extends
DefaultHost
{
private
HostLocation
location
;
/**
...
...
utils/misc/src/main/java/org/onlab/packet/ChassisId.java
View file @
e5ca93b
...
...
@@ -32,7 +32,7 @@ public final class ChassisId {
* @param value the value to use.
*/
public
ChassisId
(
String
value
)
{
this
.
value
=
Long
.
valueOf
(
value
,
16
);
this
.
value
=
Long
.
parseLong
(
value
,
16
);
}
/**
...
...
utils/misc/src/main/java/org/onlab/packet/DHCP.java
View file @
e5ca93b
...
...
@@ -379,7 +379,7 @@ public class DHCP extends BasePacket {
// 300
int
optionsLength
=
0
;
for
(
final
DHCPOption
option
:
this
.
options
)
{
if
(
option
.
getCode
()
==
0
||
option
.
getCode
()
==
255
)
{
if
(
option
.
getCode
()
==
0
||
option
.
getCode
()
==
((
byte
)
255
)
)
{
optionsLength
+=
1
;
}
else
{
optionsLength
+=
2
+
(
0xff
&
option
.
getLength
());
...
...
utils/misc/src/main/java/org/onlab/packet/IPv4.java
View file @
e5ca93b
...
...
@@ -438,7 +438,7 @@ public class IPv4 extends BasePacket {
int
result
=
0
;
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
result
|=
Integer
.
valueOf
(
octets
[
i
])
<<
(
3
-
i
)
*
8
;
result
|=
Integer
.
parseInt
(
octets
[
i
])
<<
(
3
-
i
)
*
8
;
}
return
result
;
}
...
...
@@ -471,7 +471,7 @@ public class IPv4 extends BasePacket {
int
result
=
0
;
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
result
=
ipAddress
>>
(
3
-
i
)
*
8
&
0xff
;
sb
.
append
(
Integer
.
valueOf
(
result
).
toString
()
);
sb
.
append
(
result
);
if
(
i
!=
3
)
{
sb
.
append
(
"."
);
}
...
...
utils/misc/src/main/java/org/onlab/util/HexString.java
View file @
e5ca93b
...
...
@@ -14,7 +14,7 @@ public final class HexString {
*/
public
static
String
toHexString
(
final
byte
[]
bytes
)
{
int
i
;
StringBuilder
ret
=
new
StringBuilder
();
StringBuilder
ret
=
new
StringBuilder
(
bytes
.
length
*
3
-
1
);
String
tmp
;
for
(
i
=
0
;
i
<
bytes
.
length
;
i
++)
{
if
(
i
>
0
)
{
...
...
@@ -31,22 +31,22 @@ public final class HexString {
public
static
String
toHexString
(
final
long
val
,
final
int
padTo
)
{
char
[]
arr
=
Long
.
toHexString
(
val
).
toCharArray
();
String
ret
=
""
;
String
Builder
ret
=
new
StringBuilder
(
padTo
*
3
-
1
)
;
// prepend the right number of leading zeros
int
i
=
0
;
for
(;
i
<
(
padTo
*
2
-
arr
.
length
);
i
++)
{
ret
+=
"0"
;
ret
.
append
(
'0'
)
;
if
((
i
%
2
)
!=
0
)
{
ret
+=
":"
;
ret
.
append
(
':'
)
;
}
}
for
(
int
j
=
0
;
j
<
arr
.
length
;
j
++)
{
ret
+=
arr
[
j
]
;
ret
.
append
(
arr
[
j
])
;
if
((((
i
+
j
)
%
2
)
!=
0
)
&&
(
j
<
(
arr
.
length
-
1
)))
{
ret
+=
":"
;
ret
.
append
(
':'
)
;
}
}
return
ret
;
return
ret
.
toString
()
;
}
public
static
String
toHexString
(
final
long
val
)
{
...
...
utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
View file @
e5ca93b
...
...
@@ -163,6 +163,7 @@ public class NettyMessagingService implements MessagingService {
handlers
.
putIfAbsent
(
type
,
handler
);
}
@Override
public
void
unregisterHandler
(
String
type
)
{
handlers
.
remove
(
type
);
}
...
...
@@ -242,7 +243,7 @@ public class NettyMessagingService implements MessagingService {
}
}
private
class
WriteTask
implements
Runnable
{
private
static
class
WriteTask
implements
Runnable
{
private
final
InternalMessage
message
;
private
final
Channel
channel
;
...
...
Please
register
or
login
to post a comment