From 99f15e4b9fb9c914f6c14d2cc7d4e80cbbc49b45 Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Mon, 13 Apr 2015 14:15:49 +0000 Subject: [PATCH] Bug 1153125: bug 1051056 causes "Constant subroutine redefined" warnings during t/001compile.t r=LpSolit,a=glob git-svn-id: svn://10.0.0.236/trunk@265926 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/.gitrev | 2 +- .../webtools/bugzilla/Bugzilla/API/1_0/Constants.pm | 2 +- .../bugzilla/Bugzilla/API/1_0/Resource/Bug.pm | 2 +- .../bugzilla/Bugzilla/API/1_0/Resource/Component.pm | 2 +- .../bugzilla/Bugzilla/API/1_0/Resource/FlagType.pm | 2 +- .../bugzilla/Bugzilla/API/1_0/Resource/Group.pm | 2 +- .../bugzilla/Bugzilla/API/1_0/Resource/Product.pm | 2 +- .../bugzilla/Bugzilla/API/1_0/Resource/User.pm | 2 +- .../webtools/bugzilla/Bugzilla/API/1_0/Server.pm | 2 +- mozilla/webtools/bugzilla/Bugzilla/API/1_0/Util.pm | 2 +- mozilla/webtools/bugzilla/Bugzilla/API/Server.pm | 13 +++++++------ 12 files changed, 18 insertions(+), 17 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 9607fe40b6f..218ecf3bbbc 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9379 \ No newline at end of file +9380 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index 33ec02d6907..b05954777e0 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -7d0c10e71498f2909f466fc0ccda1890595bd3ff \ No newline at end of file +d6c2d37b69eb19b0f0136112d1da45dadb42cbb4 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Constants.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Constants.pm index caf670c7bc2..44e20124ad8 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Constants.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Constants.pm @@ -15,7 +15,7 @@ use Bugzilla::Hook; use parent qw(Exporter); -our @EXPORT = qw( +our @EXPORT_OK = qw( WS_ERROR_CODE STATUS_OK diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Bug.pm index c61b2c6c292..8bdf9ae2da9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Bug.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(STATUS_CREATED); use Bugzilla::API::1_0::Util; use Bugzilla::Comment; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Component.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Component.pm index c3bdc038679..96c2a3dcdc0 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Component.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Component.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(STATUS_CREATED); use Bugzilla::API::1_0::Util; use Bugzilla::Component; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/FlagType.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/FlagType.pm index 297be1510c8..702b4d4ec7c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/FlagType.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/FlagType.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(STATUS_CREATED); use Bugzilla::API::1_0::Util; use Bugzilla::Component; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Group.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Group.pm index aee8a749259..4efd7b476bd 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Group.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Group.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(STATUS_CREATED); use Bugzilla::API::1_0::Util; use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Product.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Product.pm index 0f393e2073d..dcd4b9a6840 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Product.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/Product.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(STATUS_CREATED); use Bugzilla::API::1_0::Util; use Bugzilla::Product; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/User.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/User.pm index d2c8699073b..8b4e99e2eca 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/User.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Resource/User.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(STATUS_CREATED); use Bugzilla::API::1_0::Util; use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm index 108c25e274c..83d09c401fa 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(API_AUTH_HEADERS); use Bugzilla::API::1_0::Util qw(taint_data fix_credentials api_include_exclude); use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Util.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Util.pm index 2d83e1d2d2c..d22935f6eb4 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Util.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Util.pm @@ -11,7 +11,7 @@ use 5.10.1; use strict; use warnings; -use Bugzilla::API::1_0::Constants; +use Bugzilla::API::1_0::Constants qw(API_AUTH_HEADERS); use Bugzilla::Error; use Bugzilla::Flag; use Bugzilla::FlagType; diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/Server.pm b/mozilla/webtools/bugzilla/Bugzilla/API/Server.pm index 439f6e74363..49690103780 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/Server.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/API/Server.pm @@ -95,25 +95,26 @@ sub server { sub constants { my ($self) = @_; - my $api_version = $self->api_version; + return $self->{_constants} if defined $self->{_constants}; no strict 'refs'; + my $api_version = $self->api_version; my $class = "Bugzilla::API::${api_version}::Constants"; require_module($class); - my %constants; - foreach my $constant (@{$class . "::EXPORT"}, @{$class . "::EXPORT_OK"}) { + $self->{_constants} = {}; + foreach my $constant (@{$class . "::EXPORT_OK"}) { if (ref $class->$constant) { - $constants{$constant} = $class->$constant; + $self->{_constants}->{$constant} = $class->$constant; } else { my @list = ($class->$constant); - $constants{$constant} = (scalar(@list) == 1) ? $list[0] : \@list; + $self->{_constants}->{$constant} = (scalar(@list) == 1) ? $list[0] : \@list; } } - return \%constants; + return $self->{_constants}; } sub response_header {