Skip Menu |

This queue is for tickets about the Test-CleanNamespaces CPAN distribution.

Report information
The Basics
Id: 50106
Status: resolved
Priority: 0/
Queue: Test-CleanNamespaces

People
Owner: Nobody in particular
Requestors: DOUGDUDE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



Subject: get_method_map method has been made private
When running Test::CleanNamespaces under Moose 0.92, the following warning appears (though tests still pass): The get_method_map method has been made private. The public version is deprecated and will be removed in a future release. at /usr/local/lib/perl5/site_perl/5.10.1/mach/Class/MOP/Deprecated.pm line 119 Class::MOP::Package::get_method_map('Moose::Meta::Class=HASH(0x2842cf28)') called at /usr/local/lib/perl5/site_perl/5.10.1/Test/CleanNamespaces.pm line 47 Test::CleanNamespaces::__ANON__('Net::NSCA::Client', 'Net::NSCA::Client::DataPacket', 'Net::NSCA::Client::InitialPacket') called at /usr/local/lib/perl5/site_perl/5.10.1/Test/CleanNamespaces.pm line 66 Test::CleanNamespaces::__ANON__() called at xt/clean-namespaces.t line 19 The get_method_map method has been made private. The public version is deprecated and will be removed in a future release. at /usr/local/lib/perl5/site_perl/5.10.1/mach/Class/MOP/Deprecated.pm line 119 Class::MOP::Package::get_method_map('Moose::Meta::Class=HASH(0x28aea71c)') called at /usr/local/lib/perl5/site_perl/5.10.1/Test/CleanNamespaces.pm line 47 Test::CleanNamespaces::__ANON__('Net::NSCA::Client', 'Net::NSCA::Client::DataPacket', 'Net::NSCA::Client::InitialPacket') called at /usr/local/lib/perl5/site_perl/5.10.1/Test/CleanNamespaces.pm line 66 Test::CleanNamespaces::__ANON__() called at xt/clean-namespaces.t line 19 The get_method_map method has been made private. The public version is deprecated and will be removed in a future release. at /usr/local/lib/perl5/site_perl/5.10.1/mach/Class/MOP/Deprecated.pm line 119 Class::MOP::Package::get_method_map('Moose::Meta::Class=HASH(0x28afbbb8)') called at /usr/local/lib/perl5/site_perl/5.10.1/Test/CleanNamespaces.pm line 47 Test::CleanNamespaces::__ANON__('Net::NSCA::Client', 'Net::NSCA::Client::DataPacket', 'Net::NSCA::Client::InitialPacket') called at /usr/local/lib/perl5/site_perl/5.10.1/Test/CleanNamespaces.pm line 66 Test::CleanNamespaces::__ANON__() called at xt/clean-namespaces.t line 19
Class::MOP is version 0.94
Looks like in Class::MOP 0.93, get_method_map was made into a private method: * Class::MOP::Package - The get_method_map method is now private (and called as _full_method_map or _method_map). The public version is available as a deprecated method. (Dave Rolsky)
It looks like you can just change the get_method_map to get_method_list since you were just using the keys of get_method_map. --- lib/Test/CleanNamespaces.pm Thu Oct 01 12:01:14 2009 +++ lib/Test/CleanNamespaces.pm Thu Oct 01 12:01:37 2009 @@ -44,7 +44,7 @@ } my $meta = Class::MOP::class_of($ns) || Class::MOP::Class->initialize($ns); - my %methods = map { ($_ => 1) } keys %{ $meta->get_method_map || {} }; + my %methods = map { ($_ => 1) } $meta->get_method_list; my @symbols = keys %{ $meta->get_all_package_symbols('CODE') || {} }; my @imports = grep { !$methods{$_} } @symbols;
--- lib/Test/CleanNamespaces.pm Thu Oct 01 12:01:14 2009 +++ lib/Test/CleanNamespaces.pm Thu Oct 01 12:01:37 2009 @@ -44,7 +44,7 @@ } my $meta = Class::MOP::class_of($ns) || Class::MOP::Class->initialize($ns); - my %methods = map { ($_ => 1) } keys %{ $meta->get_method_map || {} }; + my %methods = map { ($_ => 1) } $meta->get_method_list; my @symbols = keys %{ $meta->get_all_package_symbols('CODE') || {} }; my @imports = grep { !$methods{$_} } @symbols;