BXMLSerializer: different handling of script return values

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

BXMLSerializer: different handling of script return values

Josh Highley
Apologies for not specifying the subject before sending


On Thu, Apr 21, 2016 at 2:14 PM, Josh Highley <[hidden email]> wrote:
In my bxml, I defined a TextInputContentListener method for previewInsertText in script.  The method was getting invoked, but my returned Vote seemed to get ignored.  Stepping through the code, I found that BXMLSerializer never assigns the result variable and ignores the returned value when the method is specified as an attribute but not when it's a child element.  Is there a reason for this, or is this a bug? 

I'm using 2.0.4, but the same code is in trunk

BXMLSerializer:

inner class AttributeInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
....
   // If the function didn't return a value, return the default
   Class<?> returnType = method.getReturnType();
   if (returnType == Vote.class) {
       result = Vote.APPROVE;
   } else if (returnType == Boolean.TYPE) {
       result = false;
   }

   return result;

inner class ElementInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
.....
   // If the function didn't return a value, return the default
   if (result == null) {
      Class<?> returnType = method.getReturnType();
      if (returnType == Vote.class) {
         result = Vote.APPROVE;
      } else if (returnType == Boolean.TYPE) {
         result = false;
      }
   }

   return result;

Thanks,
Josh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BXMLSerializer: different handling of script return values

Josh Highley
I must be missing something:  I've submitted Pivot issues on JIRA before (ex: PIVOT-980), but now when I go to Create Issue, Pivot isn't in the list of Projects.
Inline image 2






On Thu, Apr 21, 2016 at 2:54 PM, Roger Whitcomb <[hidden email]> wrote:

Hi Josh,

                That just looks like a bug to me.  Can you file a JIRA and provide a patch along with, and I will commit the change…

 

Thank you!

~Roger

 

From: Josh Highley [mailto:[hidden email]]
Sent: Thursday, April 21, 2016 12:15 PM
To: [hidden email]
Subject:

 

In my bxml, I defined a TextInputContentListener method for previewInsertText in script.  The method was getting invoked, but my returned Vote seemed to get ignored.  Stepping through the code, I found that BXMLSerializer never assigns the result variable and ignores the returned value when the method is specified as an attribute but not when it's a child element.  Is there a reason for this, or is this a bug? 

 

I'm using 2.0.4, but the same code is in trunk

 

BXMLSerializer:

 

inner class AttributeInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
....
   // If the function didn't return a value, return the default
   Class<?> returnType = method.getReturnType();
   if (returnType == Vote.class) {
       result = Vote.APPROVE;
   } else if (returnType == Boolean.TYPE) {
       result = false;
   }
 
   return result;
 
inner class ElementInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
.....
   // If the function didn't return a value, return the default
   if (result == null) {
      Class<?> returnType = method.getReturnType();
      if (returnType == Vote.class) {
         result = Vote.APPROVE;
      } else if (returnType == Boolean.TYPE) {
         result = false;
      }
   }
 
   return result;
 
Thanks,
Josh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BXMLSerializer: different handling of script return values

Roger and Beth Whitcomb
I just tried it and going in from pivot.apache.org if I click on the red "Create" button, Pivot shows up at the top but doesn't show up later in "All Projects". So just try again. 

Or I can create the issue and you can comment on it. 

~Roger Whitcomb

Sent from my iPhone

On Apr 22, 2016, at 7:16 AM, Josh Highley <[hidden email]> wrote:

I must be missing something:  I've submitted Pivot issues on JIRA before (ex: PIVOT-980), but now when I go to Create Issue, Pivot isn't in the list of Projects.
<image.png>






On Thu, Apr 21, 2016 at 2:54 PM, Roger Whitcomb <[hidden email]> wrote:

Hi Josh,

                That just looks like a bug to me.  Can you file a JIRA and provide a patch along with, and I will commit the change…

 

Thank you!

~Roger

 

From: Josh Highley [mailto:[hidden email]]
Sent: Thursday, April 21, 2016 12:15 PM
To: [hidden email]
Subject:

 

In my bxml, I defined a TextInputContentListener method for previewInsertText in script.  The method was getting invoked, but my returned Vote seemed to get ignored.  Stepping through the code, I found that BXMLSerializer never assigns the result variable and ignores the returned value when the method is specified as an attribute but not when it's a child element.  Is there a reason for this, or is this a bug? 

 

I'm using 2.0.4, but the same code is in trunk

 

BXMLSerializer:

 

inner class AttributeInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
....
   // If the function didn't return a value, return the default
   Class<?> returnType = method.getReturnType();
   if (returnType == Vote.class) {
       result = Vote.APPROVE;
   } else if (returnType == Boolean.TYPE) {
       result = false;
   }
 
   return result;
 
inner class ElementInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
.....
   // If the function didn't return a value, return the default
   if (result == null) {
      Class<?> returnType = method.getReturnType();
      if (returnType == Vote.class) {
         result = Vote.APPROVE;
      } else if (returnType == Boolean.TYPE) {
         result = false;
      }
   }
 
   return result;
 
Thanks,
Josh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BXMLSerializer: different handling of script return values

Roger and Beth Whitcomb
Oh, okay, I just read an announcement that there was a SPAM attack on the ASF JIRA instance and they had to change permissions across the board to only allow committers to create issues. At least for now.

So, I guess I have to create the issue. But can you send me your idea of the issue description, etc. and I will create it for you. 

Sorry about this. I'll see what I can do to fix this for you. 

Thanks,
~Roger Whitcomb

Sent from my iPhone

On Apr 22, 2016, at 8:01 AM, Roger Whitcomb <[hidden email]> wrote:

I just tried it and going in from pivot.apache.org if I click on the red "Create" button, Pivot shows up at the top but doesn't show up later in "All Projects". So just try again. 

Or I can create the issue and you can comment on it. 

~Roger Whitcomb

Sent from my iPhone

On Apr 22, 2016, at 7:16 AM, Josh Highley <[hidden email]> wrote:

I must be missing something:  I've submitted Pivot issues on JIRA before (ex: PIVOT-980), but now when I go to Create Issue, Pivot isn't in the list of Projects.
<image.png>






On Thu, Apr 21, 2016 at 2:54 PM, Roger Whitcomb <[hidden email]> wrote:

Hi Josh,

                That just looks like a bug to me.  Can you file a JIRA and provide a patch along with, and I will commit the change…

 

Thank you!

~Roger

 

From: Josh Highley [mailto:[hidden email]]
Sent: Thursday, April 21, 2016 12:15 PM
To: [hidden email]
Subject:

 

In my bxml, I defined a TextInputContentListener method for previewInsertText in script.  The method was getting invoked, but my returned Vote seemed to get ignored.  Stepping through the code, I found that BXMLSerializer never assigns the result variable and ignores the returned value when the method is specified as an attribute but not when it's a child element.  Is there a reason for this, or is this a bug? 

 

I'm using 2.0.4, but the same code is in trunk

 

BXMLSerializer:

 

inner class AttributeInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
....
   // If the function didn't return a value, return the default
   Class<?> returnType = method.getReturnType();
   if (returnType == Vote.class) {
       result = Vote.APPROVE;
   } else if (returnType == Boolean.TYPE) {
       result = false;
   }
 
   return result;
 
inner class ElementInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
.....
   // If the function didn't return a value, return the default
   if (result == null) {
      Class<?> returnType = method.getReturnType();
      if (returnType == Vote.class) {
         result = Vote.APPROVE;
      } else if (returnType == Boolean.TYPE) {
         result = false;
      }
   }
 
   return result;
 
Thanks,
Josh

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BXMLSerializer: different handling of script return values

Roger Whitcomb-2

Okay, I created issue Pivot-987 (https://issues.apache.org/jira/browse/PIVOT-987) for you with the complete description from your original email.  Go ahead and comment on it, add a patch, or whatever you'd like.


Thanks,

~Roger


From: Roger Whitcomb <[hidden email]>
Sent: Friday, April 22, 2016 8:13:09 AM
To: [hidden email]
Subject: Re: BXMLSerializer: different handling of script return values
 
Oh, okay, I just read an announcement that there was a SPAM attack on the ASF JIRA instance and they had to change permissions across the board to only allow committers to create issues. At least for now.

So, I guess I have to create the issue. But can you send me your idea of the issue description, etc. and I will create it for you. 

Sorry about this. I'll see what I can do to fix this for you. 

Thanks,
~Roger Whitcomb

Sent from my iPhone

On Apr 22, 2016, at 8:01 AM, Roger Whitcomb <[hidden email]> wrote:

I just tried it and going in from pivot.apache.org if I click on the red "Create" button, Pivot shows up at the top but doesn't show up later in "All Projects". So just try again. 

Or I can create the issue and you can comment on it. 

~Roger Whitcomb

Sent from my iPhone

On Apr 22, 2016, at 7:16 AM, Josh Highley <[hidden email]> wrote:

I must be missing something:  I've submitted Pivot issues on JIRA before (ex: PIVOT-980), but now when I go to Create Issue, Pivot isn't in the list of Projects.
<image.png>






On Thu, Apr 21, 2016 at 2:54 PM, Roger Whitcomb <[hidden email]> wrote:

Hi Josh,

                That just looks like a bug to me.  Can you file a JIRA and provide a patch along with, and I will commit the change…

 

Thank you!

~Roger

 

From: Josh Highley [mailto:[hidden email]]
Sent: Thursday, April 21, 2016 12:15 PM
To: [hidden email]
Subject:

 

In my bxml, I defined a TextInputContentListener method for previewInsertText in script.  The method was getting invoked, but my returned Vote seemed to get ignored.  Stepping through the code, I found that BXMLSerializer never assigns the result variable and ignores the returned value when the method is specified as an attribute but not when it's a child element.  Is there a reason for this, or is this a bug? 

 

I'm using 2.0.4, but the same code is in trunk

 

BXMLSerializer:

 

inner class AttributeInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
....
   // If the function didn't return a value, return the default
   Class<?> returnType = method.getReturnType();
   if (returnType == Vote.class) {
       result = Vote.APPROVE;
   } else if (returnType == Boolean.TYPE) {
       result = false;
   }
 
   return result;
 
inner class ElementInvocationHandler, method invoke(Object proxy, Method method, Object[] args)
.....
   // If the function didn't return a value, return the default
   if (result == null) {
      Class<?> returnType = method.getReturnType();
      if (returnType == Vote.class) {
         result = Vote.APPROVE;
      } else if (returnType == Boolean.TYPE) {
         result = false;
      }
   }
 
   return result;
 
Thanks,
Josh

Loading...