OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 static InvalidProtocolBufferException invalidTag() { | 100 static InvalidProtocolBufferException invalidTag() { |
101 return new InvalidProtocolBufferException( | 101 return new InvalidProtocolBufferException( |
102 "Protocol message contained an invalid tag (zero)."); | 102 "Protocol message contained an invalid tag (zero)."); |
103 } | 103 } |
104 | 104 |
105 static InvalidProtocolBufferException invalidEndTag() { | 105 static InvalidProtocolBufferException invalidEndTag() { |
106 return new InvalidProtocolBufferException( | 106 return new InvalidProtocolBufferException( |
107 "Protocol message end-group tag did not match expected tag."); | 107 "Protocol message end-group tag did not match expected tag."); |
108 } | 108 } |
109 | 109 |
110 static InvalidWireTypeException invalidWireType() { | 110 static InvalidProtocolBufferException invalidWireType() { |
111 return new InvalidWireTypeException( | 111 return new InvalidProtocolBufferException( |
112 "Protocol message tag had invalid wire type."); | 112 "Protocol message tag had invalid wire type."); |
113 } | 113 } |
114 | 114 |
115 /** | |
116 * Exception indicating that and unexpected wire type was encountered for a fi
eld. | |
117 */ | |
118 @ExperimentalApi | |
119 public static class InvalidWireTypeException extends InvalidProtocolBufferExce
ption { | |
120 private static final long serialVersionUID = 3283890091615336259L; | |
121 | |
122 public InvalidWireTypeException(String description) { | |
123 super(description); | |
124 } | |
125 } | |
126 | |
127 static InvalidProtocolBufferException recursionLimitExceeded() { | 115 static InvalidProtocolBufferException recursionLimitExceeded() { |
128 return new InvalidProtocolBufferException( | 116 return new InvalidProtocolBufferException( |
129 "Protocol message had too many levels of nesting. May be malicious. " + | 117 "Protocol message had too many levels of nesting. May be malicious. " + |
130 "Use CodedInputStream.setRecursionLimit() to increase the depth limit."); | 118 "Use CodedInputStream.setRecursionLimit() to increase the depth limit."); |
131 } | 119 } |
132 | 120 |
133 static InvalidProtocolBufferException sizeLimitExceeded() { | 121 static InvalidProtocolBufferException sizeLimitExceeded() { |
134 return new InvalidProtocolBufferException( | 122 return new InvalidProtocolBufferException( |
135 "Protocol message was too large. May be malicious. " + | 123 "Protocol message was too large. May be malicious. " + |
136 "Use CodedInputStream.setSizeLimit() to increase the size limit."); | 124 "Use CodedInputStream.setSizeLimit() to increase the size limit."); |
137 } | 125 } |
138 | 126 |
139 static InvalidProtocolBufferException parseFailure() { | 127 static InvalidProtocolBufferException parseFailure() { |
140 return new InvalidProtocolBufferException("Failed to parse the message."); | 128 return new InvalidProtocolBufferException("Failed to parse the message."); |
141 } | 129 } |
142 | 130 |
143 static InvalidProtocolBufferException invalidUtf8() { | 131 static InvalidProtocolBufferException invalidUtf8() { |
144 return new InvalidProtocolBufferException("Protocol message had invalid UTF-
8."); | 132 return new InvalidProtocolBufferException("Protocol message had invalid UTF-
8."); |
145 } | 133 } |
146 } | 134 } |
OLD | NEW |