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 5package org.chromium.base; 6 7import java.lang.annotation.ElementType; 8import java.lang.annotation.Retention; 9import java.lang.annotation.RetentionPolicy; 10import 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) 22public @interface CalledByNativeUnchecked { 23 /* 24 * If present, tells which inner class the method belongs to. 25 */ 26 public String value() default ""; 27} 28