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 3 // found in the LICENSE file. 4 5 package org.chromium.base.annotations; 6 7 import java.lang.annotation.ElementType; 8 import java.lang.annotation.Retention; 9 import java.lang.annotation.RetentionPolicy; 10 import java.lang.annotation.Target; 11 12 /** 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. 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. 17 * Usage of this should be very rare; where possible handle exceptions in the Java side and use a 18 * return value to indicate success / failure. 19 */ 20 @Target(ElementType.METHOD) 21 @Retention(RetentionPolicy.CLASS) 22 public @interface CalledByNativeUnchecked { 23 /* 24 * If present, tells which inner class the method belongs to. 25 */ value()26 public String value() default ""; 27 } 28