Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
7e90fbfc
Commit
7e90fbfc
authored
Oct 28, 2015
by
Christian Schudt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary (un)boxing of primitive types.
parent
09dde899
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
BrowserLauncher.java
...a/org/jivesoftware/openfire/launcher/BrowserLauncher.java
+1
-1
ByteFormat.java
src/java/org/jivesoftware/util/ByteFormat.java
+3
-3
No files found.
src/java/org/jivesoftware/openfire/launcher/BrowserLauncher.java
View file @
7e90fbfc
...
...
@@ -284,7 +284,7 @@ public class BrowserLauncher {
String
mrjVersion
=
System
.
getProperty
(
"mrj.version"
);
String
majorMRJVersion
=
mrjVersion
.
substring
(
0
,
3
);
try
{
double
version
=
Double
.
valueOf
(
majorMRJVersion
)
.
doubleValue
()
;
double
version
=
Double
.
valueOf
(
majorMRJVersion
);
if
(
version
==
2
)
{
jvm
=
MRJ_2_0
;
}
...
...
src/java/org/jivesoftware/util/ByteFormat.java
View file @
7e90fbfc
...
...
@@ -37,14 +37,14 @@ public class ByteFormat extends Format {
* Formats a long which represent a number of bytes.
*/
public
String
format
(
long
bytes
)
{
return
format
(
new
Long
(
bytes
)
);
return
format
(
bytes
);
}
/**
* Formats a long which represent a number of kilobytes.
*/
public
String
formatKB
(
long
kilobytes
)
{
return
format
(
new
Long
(
kilobytes
*
1024
)
);
return
format
(
kilobytes
*
1024
);
}
/**
...
...
@@ -58,7 +58,7 @@ public class ByteFormat extends Format {
@Override
public
StringBuffer
format
(
Object
obj
,
StringBuffer
buf
,
FieldPosition
pos
)
{
if
(
obj
instanceof
Long
)
{
long
numBytes
=
(
(
Long
)
obj
).
longValue
()
;
long
numBytes
=
(
Long
)
obj
;
if
(
numBytes
<
1024
*
1024
)
{
DecimalFormat
formatter
=
new
DecimalFormat
(
"#,##0.0"
);
buf
.
append
(
formatter
.
format
((
double
)
numBytes
/
1024.0
)).
append
(
" K"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment