[Pkg-libvirt-commits] [libguestfs] 16/21: java: add @Deprecated annotation for deprecated methods
Hilko Bengen
bengen at moszumanska.debian.org
Sun May 3 21:27:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit 4a1952bcf4a831f5b2640b1c10cf0664c97e1bc6
Author: Pino Toscano <ptoscano at redhat.com>
Date: Tue Feb 10 15:10:34 2015 +0100
java: add @Deprecated annotation for deprecated methods
(cherry picked from commit 85b6b5e589bea56046b85a5b0143a364e20dacd1)
---
generator/java.ml | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/generator/java.ml b/generator/java.ml
index 9b52d48..9ae4eea 100644
--- a/generator/java.ml
+++ b/generator/java.ml
@@ -280,7 +280,11 @@ public class GuestFS {
pr " */\n";
);
pr " ";
- generate_java_prototype ~public:true ~semicolon:false f.name f.style;
+ let deprecated =
+ match f with
+ | { deprecated_by = None } -> false
+ | { deprecated_by = Some _ } -> true in
+ generate_java_prototype ~public:true ~semicolon:false ~deprecated f.name f.style;
pr "\n";
pr " {\n";
pr " if (g == 0)\n";
@@ -421,7 +425,8 @@ and generate_java_call_args ~handle (_, args, optargs) =
pr ")"
and generate_java_prototype ?(public=false) ?(privat=false) ?(native=false)
- ?(semicolon=true) name (ret, args, optargs) =
+ ?(semicolon=true) ?(deprecated=false) name (ret, args, optargs) =
+ if deprecated then pr "@Deprecated ";
if privat then pr "private ";
if public then pr "public ";
if native then pr "native ";
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list