diff Lib/IMPL/TypeKeyedCollection.pm @ 317:96a522aeb359

small fixes
author cin
date Thu, 09 May 2013 04:10:00 +0400
parents 608beb8b3c6c
children de1f875e8875
line wrap: on
line diff
--- a/Lib/IMPL/TypeKeyedCollection.pm	Wed May 08 16:19:34 2013 +0400
+++ b/Lib/IMPL/TypeKeyedCollection.pm	Thu May 09 04:10:00 2013 +0400
@@ -27,8 +27,8 @@
 sub Get {
 	my ($this,$type) = @_;
 	
-	die ArgException->(type => 'Invalid type', $type)
-	   if ref($type);
+	die ArgException->new(type => 'Invalid type', $type)
+	   if not $type or ref($type);
 
     if(my $val = $this->{$_cache}{$type}) {
     	return $val;
@@ -42,7 +42,7 @@
 
 			$val = $this->{$_items}{$sclass};
 			
-			return $this->{$_cache}{$type} = $val
+			return($this->{$_cache}{$type} = $val)
                 if defined $val; # zeroes and empty strings are also valid
                 
             push @isa, @{"${sclass}::ISA"};
@@ -54,8 +54,8 @@
 sub Set {
 	my ($this,$type,$value) = @_;
 	
-	die ArgException->(type => 'Invalid type', $type)
-       if ref($type);
+	die ArgException->new(type => 'Invalid type', $type)
+       if not $type or ref($type);
        
     $this->{$_items}{$type} = $value;