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

Side by Side Diff: third_party/protobuf/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 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 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2013 Google Inc. All rights reserved. 2 // Copyright 2013 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/ 3 // https://developers.google.com/protocol-buffers/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // non-proto-field name collisions (hashCode() and getSerialized Size()) 149 // non-proto-field name collisions (hashCode() and getSerialized Size())
150 if (name.startsWith("set")) { 150 if (name.startsWith("set")) {
151 String subfieldName = name.substring(3); 151 String subfieldName = name.substring(3);
152 152
153 Method hazzer = null; 153 Method hazzer = null;
154 try { 154 try {
155 hazzer = clazz.getMethod("has" + subfieldName); 155 hazzer = clazz.getMethod("has" + subfieldName);
156 } catch (NoSuchMethodException e) { 156 } catch (NoSuchMethodException e) {
157 continue; 157 continue;
158 } 158 }
159 // If hazzer does't exist or returns false, no need to conti nue 159 // If hazzer doesn't exist or returns false, no need to cont inue
160 if (!(Boolean) hazzer.invoke(object)) { 160 if (!(Boolean) hazzer.invoke(object)) {
161 continue; 161 continue;
162 } 162 }
163 163
164 Method getter = null; 164 Method getter = null;
165 try { 165 try {
166 getter = clazz.getMethod("get" + subfieldName); 166 getter = clazz.getMethod("get" + subfieldName);
167 } catch (NoSuchMethodException e) { 167 } catch (NoSuchMethodException e) {
168 continue; 168 continue;
169 } 169 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 builder.append('\\').append((char) ch); 266 builder.append('\\').append((char) ch);
267 } else if (ch >= 32 && ch < 127) { 267 } else if (ch >= 32 && ch < 127) {
268 builder.append((char) ch); 268 builder.append((char) ch);
269 } else { 269 } else {
270 builder.append(String.format("\\%03o", ch)); 270 builder.append(String.format("\\%03o", ch));
271 } 271 }
272 } 272 }
273 builder.append('"'); 273 builder.append('"');
274 } 274 }
275 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698