Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: mojo/public/tools/bindings/generators/java_templates/data_types_definition.tmpl

Issue 1529093004: [mojo] Suppress findbugs errors on generated bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 {% from "constant_definition.tmpl" import constant_def %} 1 {% from "constant_definition.tmpl" import constant_def %}
2 {% from "enum_definition.tmpl" import enum_def %} 2 {% from "enum_definition.tmpl" import enum_def %}
3 3
4 {%- macro equality(kind, v1, v2, ne=False) -%} 4 {%- macro equality(kind, v1, v2, ne=False) -%}
5 {%- if kind|is_reference_kind -%} 5 {%- if kind|is_reference_kind -%}
6 {%- if kind|is_array_kind -%} 6 {%- if kind|is_array_kind -%}
7 {%- if kind.kind|is_reference_kind -%} 7 {%- if kind.kind|is_reference_kind -%}
8 {% if ne %}!{% endif %}java.util.Arrays.deepEquals({{v1}}, {{v2}}) 8 {% if ne %}!{% endif %}java.util.Arrays.deepEquals({{v1}}, {{v2}})
9 {%- else -%} 9 {%- else -%}
10 {% if ne %}!{% endif %}java.util.Arrays.equals({{v1}}, {{v2}}) 10 {% if ne %}!{% endif %}java.util.Arrays.equals({{v1}}, {{v2}})
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 public int which() { 255 public int which() {
256 return mTag_; 256 return mTag_;
257 } 257 }
258 258
259 public boolean isUnknown() { 259 public boolean isUnknown() {
260 return mTag_ == -1; 260 return mTag_ == -1;
261 } 261 }
262 {% for field in union.fields %} 262 {% for field in union.fields %}
263 263
264 // TODO(rockot): Fix the findbugs error and remove this suppression.
265 // See http://crbug.com/570386.
266 @SuppressFBWarnings("EI_EXPOSE_REP2")
264 public void set{{field|ucc}}({{field.kind|java_type}} {{field|name}}) { 267 public void set{{field|ucc}}({{field.kind|java_type}} {{field|name}}) {
265 mTag_ = {{field.ordinal}}; 268 mTag_ = {{field.ordinal}};
266 m{{field|ucc}} = {{field|name}}; 269 m{{field|ucc}} = {{field|name}};
267 } 270 }
268 271
272 // TODO(rockot): Fix the findbugs error and remove this suppression.
273 // See http://crbug.com/570386.
274 @SuppressFBWarnings("EI_EXPOSE_REP")
269 public {{field.kind|java_type}} get{{field|ucc}}() { 275 public {{field.kind|java_type}} get{{field|ucc}}() {
270 assert mTag_ == {{field.ordinal}}; 276 assert mTag_ == {{field.ordinal}};
271 return m{{field|ucc}}; 277 return m{{field|ucc}};
272 } 278 }
273 {% endfor %} 279 {% endfor %}
274 280
275 281
276 @Override 282 @Override
277 protected final void encode(org.chromium.mojo.bindings.Encoder encoder0, int offset) { 283 protected final void encode(org.chromium.mojo.bindings.Encoder encoder0, int offset) {
278 encoder0.encode(org.chromium.mojo.bindings.BindingsHelper.UNION_SIZE, of fset); 284 encoder0.encode(org.chromium.mojo.bindings.BindingsHelper.UNION_SIZE, of fset);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 377 }
372 {% endfor %} 378 {% endfor %}
373 default: { 379 default: {
374 break; 380 break;
375 } 381 }
376 } 382 }
377 return result; 383 return result;
378 } 384 }
379 } 385 }
380 {% endmacro %} 386 {% endmacro %}
OLDNEW
« no previous file with comments | « mojo/public/java/BUILD.gn ('k') | mojo/public/tools/bindings/generators/java_templates/header.java.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698