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
7c753441
Commit
7c753441
authored
Mar 09, 2017
by
Jisi Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lint warnings in the javalite branch.
parent
cad6a51a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
0 deletions
+11
-0
GeneratedMessage.java
...e/src/main/java/com/google/protobuf/GeneratedMessage.java
+4
-0
GeneratedMessageLite.java
...c/main/java/com/google/protobuf/GeneratedMessageLite.java
+2
-0
MapEntry.java
java/core/src/main/java/com/google/protobuf/MapEntry.java
+2
-0
MapField.java
java/core/src/main/java/com/google/protobuf/MapField.java
+1
-0
java_message.cc
src/google/protobuf/compiler/java/java_message.cc
+1
-0
java_message_lite.cc
src/google/protobuf/compiler/java/java_message_lite.cc
+1
-0
No files found.
java/core/src/main/java/com/google/protobuf/GeneratedMessage.java
View file @
7c753441
...
...
@@ -854,6 +854,7 @@ public abstract class GeneratedMessage extends AbstractMessage
/** Check if a singular extension is present. */
@Override
@SuppressWarnings
(
"unchecked"
)
public
final
<
Type
>
boolean
hasExtension
(
final
ExtensionLite
<
MessageType
,
Type
>
extensionLite
)
{
Extension
<
MessageType
,
Type
>
extension
=
checkNotLite
(
extensionLite
);
...
...
@@ -863,6 +864,7 @@ public abstract class GeneratedMessage extends AbstractMessage
/** Get the number of elements in a repeated extension. */
@Override
@SuppressWarnings
(
"unchecked"
)
public
final
<
Type
>
int
getExtensionCount
(
final
ExtensionLite
<
MessageType
,
List
<
Type
>>
extensionLite
)
{
Extension
<
MessageType
,
List
<
Type
>>
extension
=
checkNotLite
(
extensionLite
);
...
...
@@ -2555,6 +2557,7 @@ public abstract class GeneratedMessage extends AbstractMessage
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
Object
get
(
GeneratedMessage
message
)
{
List
result
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
getRepeatedCount
(
message
);
i
++)
{
...
...
@@ -2564,6 +2567,7 @@ public abstract class GeneratedMessage extends AbstractMessage
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
Object
get
(
Builder
builder
)
{
List
result
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
getRepeatedCount
(
builder
);
i
++)
{
...
...
java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java
View file @
7c753441
...
...
@@ -220,6 +220,7 @@ public abstract class GeneratedMessageLite<
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
final
BuilderType
toBuilder
()
{
BuilderType
builder
=
(
BuilderType
)
dynamicMethod
(
MethodToInvoke
.
NEW_BUILDER
);
builder
.
mergeFrom
((
MessageType
)
this
);
...
...
@@ -453,6 +454,7 @@ public abstract class GeneratedMessageLite<
*/
protected
FieldSet
<
ExtensionDescriptor
>
extensions
=
FieldSet
.
newFieldSet
();
@SuppressWarnings
(
"unchecked"
)
protected
final
void
mergeExtensionFields
(
final
MessageType
other
)
{
if
(
extensions
.
isImmutable
())
{
extensions
=
extensions
.
clone
();
...
...
java/core/src/main/java/com/google/protobuf/MapEntry.java
View file @
7c753441
...
...
@@ -89,6 +89,7 @@ public final class MapEntry<K, V> extends AbstractMessage {
}
/** Create a MapEntry with the provided key and value. */
@SuppressWarnings
(
"unchecked"
)
private
MapEntry
(
Metadata
metadata
,
K
key
,
V
value
)
{
this
.
key
=
key
;
this
.
value
=
value
;
...
...
@@ -435,6 +436,7 @@ public final class MapEntry<K, V> extends AbstractMessage {
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
Builder
<
K
,
V
>
clone
()
{
return
new
Builder
(
metadata
,
key
,
value
);
}
...
...
java/core/src/main/java/com/google/protobuf/MapField.java
View file @
7c753441
...
...
@@ -100,6 +100,7 @@ public class MapField<K, V> implements MutabilityOracle {
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
void
convertMessageToKeyAndValue
(
Message
message
,
Map
<
K
,
V
>
map
)
{
MapEntry
<
K
,
V
>
entry
=
(
MapEntry
<
K
,
V
>)
message
;
map
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
...
...
src/google/protobuf/compiler/java/java_message.cc
View file @
7c753441
...
...
@@ -1453,6 +1453,7 @@ void ImmutableMessageGenerator::GenerateAnyMethods(io::Printer* printer) {
"
\n
"
"private volatile com.google.protobuf.Message cachedUnpackValue;
\n
"
"
\n
"
"@java.lang.SuppressWarnings(
\"
unchecked
\"
)
\n
"
"public <T extends com.google.protobuf.Message> T unpack(
\n
"
" java.lang.Class<T> clazz)
\n
"
" throws com.google.protobuf.InvalidProtocolBufferException {
\n
"
...
...
src/google/protobuf/compiler/java/java_message_lite.cc
View file @
7c753441
...
...
@@ -345,6 +345,7 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) {
}
printer
->
Print
(
"@java.lang.SuppressWarnings(
\"
unchecked
\"
)
\n
"
"protected final Object dynamicMethod(
\n
"
" com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
\n
"
" Object arg0, Object arg1) {
\n
"
...
...
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