[ 
https://issues.apache.org/jira/browse/THRIFT-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16474195#comment-16474195
 ] 

ASF GitHub Bot commented on THRIFT-4382:
----------------------------------------

jeking3 commented on a change in pull request #1261: THRIFT-4382: Replace the 
use of Indirect Object Syntax calls to new()
URL: https://github.com/apache/thrift/pull/1261#discussion_r187948194
 
 

 ##########
 File path: test/perl/TestServer.pl
 ##########
 @@ -376,19 +382,21 @@ ()
   my $arg5 = shift;
 
   print("testMulti()\n");
-  return new ThriftTest::Xtruct({string_thing => "Hello2", byte_thing => 
$arg0, i32_thing => $arg1, i64_thing => $arg2});
+  return ThriftTest::Xtruct->new({string_thing => "Hello2", byte_thing => 
$arg0, i32_thing => $arg1, i64_thing => $arg2});
 }
 
 sub testException() {
   my $self = shift;
   my $arg = shift;
   print("testException($arg)\n");
-  if ($arg eq "Xception") {
-    die new ThriftTest::Xception({errorCode => 1001, message => $arg});
-  } elsif ($arg eq "TException") {
-    die "astring"; # all unhandled exceptions become TExceptions
-  } else {
-    return new ThriftTest::Xtruct({string_thing => $arg});
+  if ($arg eq 'Xception') {
 
 Review comment:
   Not sure these indentation changes are necessary, I prefer the previous way. 
 Is there a canonical perl style guide that reflects this?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace the use of Perl Indirect Object Syntax calls to new() 
> --------------------------------------------------------------
>
>                 Key: THRIFT-4382
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4382
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Perl - Compiler
>            Reporter: Dean Hamstead
>            Priority: Minor
>
> Using Indirect Object Syntax to instantiate objects is not recommended as per 
> https://perldoc.perl.org/perlobj.html#Invoking-Class-Methods



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to