Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
9b8f6589
Commit
9b8f6589
authored
Jul 25, 2017
by
Jisi Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dependency on guava 20
parent
d974cc2e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
Durations.java
...til/src/main/java/com/google/protobuf/util/Durations.java
+4
-6
Timestamps.java
...il/src/main/java/com/google/protobuf/util/Timestamps.java
+4
-6
No files found.
java/util/src/main/java/com/google/protobuf/util/Durations.java
View file @
9b8f6589
...
...
@@ -30,7 +30,6 @@
package
com
.
google
.
protobuf
.
util
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkArgument
;
import
static
com
.
google
.
common
.
math
.
IntMath
.
checkedAdd
;
import
static
com
.
google
.
common
.
math
.
IntMath
.
checkedSubtract
;
import
static
com
.
google
.
common
.
math
.
LongMath
.
checkedAdd
;
...
...
@@ -135,14 +134,13 @@ public final class Durations {
public
static
Duration
checkValid
(
Duration
duration
)
{
long
seconds
=
duration
.
getSeconds
();
int
nanos
=
duration
.
getNanos
();
checkArgument
(
isValid
(
seconds
,
nanos
),
if
(!
isValid
(
seconds
,
nanos
))
{
throw
new
IllegalArgumentException
(
String
.
format
(
"Duration is not valid. See proto definition for valid values. "
+
"Seconds (%s) must be in range [-315,576,000,000, +315,576,000,000]. "
+
"Nanos (%s) must be in range [-999,999,999, +999,999,999]. "
+
"Nanos must have the same sign as seconds"
,
seconds
,
nanos
);
+
"Nanos must have the same sign as seconds"
,
seconds
,
nanos
));
}
return
duration
;
}
...
...
java/util/src/main/java/com/google/protobuf/util/Timestamps.java
View file @
9b8f6589
...
...
@@ -30,7 +30,6 @@
package
com
.
google
.
protobuf
.
util
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkArgument
;
import
static
com
.
google
.
common
.
math
.
IntMath
.
checkedAdd
;
import
static
com
.
google
.
common
.
math
.
IntMath
.
checkedSubtract
;
import
static
com
.
google
.
common
.
math
.
LongMath
.
checkedAdd
;
...
...
@@ -160,13 +159,12 @@ public final class Timestamps {
public
static
Timestamp
checkValid
(
Timestamp
timestamp
)
{
long
seconds
=
timestamp
.
getSeconds
();
int
nanos
=
timestamp
.
getNanos
();
checkArgument
(
isValid
(
seconds
,
nanos
),
if
(!
isValid
(
seconds
,
nanos
))
{
throw
new
IllegalArgumentException
(
String
.
format
(
"Timestamp is not valid. See proto definition for valid values. "
+
"Seconds (%s) must be in range [-62,135,596,800, +253,402,300,799]. "
+
"Nanos (%s) must be in range [0, +999,999,999]."
,
seconds
,
nanos
);
+
"Nanos (%s) must be in range [0, +999,999,999]."
,
seconds
,
nanos
));
}
return
timestamp
;
}
...
...
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