OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.base; | 5 package org.chromium.base.annotations; |
6 | 6 |
7 import java.lang.annotation.ElementType; | 7 import java.lang.annotation.ElementType; |
8 import java.lang.annotation.Retention; | 8 import java.lang.annotation.Retention; |
9 import java.lang.annotation.RetentionPolicy; | 9 import java.lang.annotation.RetentionPolicy; |
10 import java.lang.annotation.Target; | 10 import java.lang.annotation.Target; |
11 | 11 |
12 /** | 12 /** |
13 * @CalledByNativeUnchecked is used to generate JNI bindings that do not check
for exceptions. | 13 * @CalledByNativeUnchecked is used to generate JNI bindings that do not check
for exceptions. |
14 * It only makes sense to use this annotation on methods that declare a throws.
.. spec. | 14 * It only makes sense to use this annotation on methods that declare a throws.
.. spec. |
15 * However, note that the exception received native side maybe an 'unchecked' (
RuntimeExpception) | 15 * However, note that the exception received native side maybe an 'unchecked' (
RuntimeExpception) |
16 * such as NullPointerException, so the native code should differentiate these
cases. | 16 * such as NullPointerException, so the native code should differentiate these
cases. |
17 * Usage of this should be very rare; where possible handle exceptions in the J
ava side and use a | 17 * Usage of this should be very rare; where possible handle exceptions in the J
ava side and use a |
18 * return value to indicate success / failure. | 18 * return value to indicate success / failure. |
19 */ | 19 */ |
20 @Target(ElementType.METHOD) | 20 @Target(ElementType.METHOD) |
21 @Retention(RetentionPolicy.CLASS) | 21 @Retention(RetentionPolicy.CLASS) |
22 public @interface CalledByNativeUnchecked { | 22 public @interface CalledByNativeUnchecked { |
23 /* | 23 /* |
24 * If present, tells which inner class the method belongs to. | 24 * If present, tells which inner class the method belongs to. |
25 */ | 25 */ |
26 public String value() default ""; | 26 public String value() default ""; |
27 } | 27 } |
OLD | NEW |