From 607621920fd5a74e4b0d69a0353d8da6b960f3ce Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Tue, 12 Apr 2016 15:45:26 -0700 Subject: [PATCH] PrivacySource and PrivacySink annotations Reviewed By: mburman Differential Revision: D3170929 fb-gh-sync-id: c594902 fbshipit-source-id: c594902 --- .../infer/annotation/PrivacySink.java | 23 +++++++++++++++++ .../infer/annotation/PrivacySource.java | 25 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 infer/annotations/com/facebook/infer/annotation/PrivacySink.java create mode 100644 infer/annotations/com/facebook/infer/annotation/PrivacySource.java diff --git a/infer/annotations/com/facebook/infer/annotation/PrivacySink.java b/infer/annotations/com/facebook/infer/annotation/PrivacySink.java new file mode 100644 index 000000000..2be3ffcf9 --- /dev/null +++ b/infer/annotations/com/facebook/infer/annotation/PrivacySink.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2004 - present Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +package com.facebook.infer.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.CLASS) +@Target( + ElementType.PARAMETER // a privacy source should not flow to this parameter + ) + +public @interface PrivacySink { +} diff --git a/infer/annotations/com/facebook/infer/annotation/PrivacySource.java b/infer/annotations/com/facebook/infer/annotation/PrivacySource.java new file mode 100644 index 000000000..57b7fe507 --- /dev/null +++ b/infer/annotations/com/facebook/infer/annotation/PrivacySource.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2004 - present Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +package com.facebook.infer.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.CLASS) +@Target(value={ + ElementType.METHOD, // method returns something private + ElementType.PARAMETER, // parameter is private + ElementType.FIELD, // field is private + }) + +public @interface PrivacySource { +}