You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Piotr Kołaczkowski (Created JIRA)" <ji...@apache.org> on 2011/11/01 15:43:32 UTC

[jira] [Created] (PIVOT-813) BXML annotation should work for JavaBean properties

BXML annotation should work for JavaBean properties
---------------------------------------------------

                 Key: PIVOT-813
                 URL: https://issues.apache.org/jira/browse/PIVOT-813
             Project: Pivot
          Issue Type: Improvement
          Components: core-beans
    Affects Versions: 2.0.1
            Reporter: Piotr Kołaczkowski


Consider the following code:

public class Bean {

  @BXML
  private String field;

  public void setField(String field) { 
    this.field = field;
  } 

  public String getField() {
    return field;
  }  

  // ...
}

Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.

Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Sandro Martini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-813:
---------------------------------

    Affects Version/s:     (was: 2.0.1)
                       2.0
        Fix Version/s: 2.0.1

This could be another great thing to have in 2.0.1 , if someone wants to fix it assign, otherwise I'll assign to me and fix (probably next week).

                
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0
>            Reporter: Piotr Kołaczkowski
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>             Fix For: 2.0.1
>
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Assigned] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Sandro Martini (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini reassigned PIVOT-813:
------------------------------------

    Assignee: Sandro Martini
    
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0
>            Reporter: Piotr Kołaczkowski
>            Assignee: Sandro Martini
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>             Fix For: 2.0.1
>
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Sandro Martini (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142754#comment-13142754 ] 

Sandro Martini commented on PIVOT-813:
--------------------------------------

If possible tomorrow I'll to put (under tests) a test application, with a simple test (like that described by Piotr, usign the @BXML annotation), taking as a sample SuggestionPopupTest .

If someone has news in the meantime ...

                
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0
>            Reporter: Piotr Kołaczkowski
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>             Fix For: 2.0.1
>
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Noel Grandin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13142068#comment-13142068 ] 

Noel Grandin commented on PIVOT-813:
------------------------------------

This is working for me. What exception did you see?
                
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0
>            Reporter: Piotr Kołaczkowski
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>             Fix For: 2.0.1
>
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Sandro Martini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini updated PIVOT-813:
---------------------------------

    Attachment: pivot_813 - Applet.launch
                custom_panel.bxml.launch

add sample eclipse launch files to run test classes both as a standalone application (no security manager) and with appletviewer (using a default security manager)

Using these samples all is working in my environments, so I'm guessing the problem seen here, if it's still valid.
Or if the problem is different, please give me more info.

Tell me something.
Thank you.

                
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0
>            Reporter: Piotr Kołaczkowski
>            Assignee: Sandro Martini
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>             Fix For: 2.0.1
>
>         Attachments: custom_panel.bxml.launch, pivot_813 - Applet.launch
>
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Piotr Kołaczkowski (Updated JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Piotr Kołaczkowski updated PIVOT-813:
-------------------------------------

    Description: 
Consider the following code:

public class Bean implements Bindable {

  @BXML
  private String field;

  public void setField(String field) { 
    this.field = field;
  } 

  public String getField() {
    return field;
  }  

  // ...
}

Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.

Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.


  was:
Consider the following code:

public class Bean {

  @BXML
  private String field;

  public void setField(String field) { 
    this.field = field;
  } 

  public String getField() {
    return field;
  }  

  // ...
}

Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.

Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.


    
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0.1
>            Reporter: Piotr Kołaczkowski
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>
> Consider the following code:
> public class Bean implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Sandro Martini (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13146019#comment-13146019 ] 

Sandro Martini commented on PIVOT-813:
--------------------------------------

Just committed CustomPanel.java and custom_panel.bxml, under tests, to start looking at this ... probably I'll need even a launch file to run them with appletviewer and see in a sandboxed environment what happens.

                
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0
>            Reporter: Piotr Kołaczkowski
>            Assignee: Sandro Martini
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>             Fix For: 2.0.1
>
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Piotr Kołaczkowski (Updated JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Piotr Kołaczkowski updated PIVOT-813:
-------------------------------------

    Description: 
Consider the following code:

public class MyComponent extends Panel implements Bindable {

  @BXML
  private String field;

  public void setField(String field) { 
    this.field = field;
  } 

  public String getField() {
    return field;
  }  

  // ...
}

Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.

Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.


  was:
Consider the following code:

public class Bean implements Bindable {

  @BXML
  private String field;

  public void setField(String field) { 
    this.field = field;
  } 

  public String getField() {
    return field;
  }  

  // ...
}

Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.

Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.


    
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0.1
>            Reporter: Piotr Kołaczkowski
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Resolved] (PIVOT-813) BXML annotation should work for JavaBean properties

Posted by "Noel Grandin (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noel Grandin resolved PIVOT-813.
--------------------------------

    Resolution: Fixed

Tested using Sandro's code and launch files, and as far as I can tell this is fixed.

Please re-open with additional test cases if there is still a problem.
                
> BXML annotation should work for JavaBean properties
> ---------------------------------------------------
>
>                 Key: PIVOT-813
>                 URL: https://issues.apache.org/jira/browse/PIVOT-813
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>    Affects Versions: 2.0
>            Reporter: Piotr Kołaczkowski
>            Assignee: Sandro Martini
>              Labels: BXML, BXMLSerializer, access, annotation, field, property
>             Fix For: 2.0.1
>
>         Attachments: custom_panel.bxml.launch, pivot_813 - Applet.launch
>
>
> Consider the following code:
> public class MyComponent extends Panel implements Bindable {
>   @BXML
>   private String field;
>   public void setField(String field) { 
>     this.field = field;
>   } 
>   public String getField() {
>     return field;
>   }  
>   // ...
> }
> Current behaviour: the BXML serializer attempts to set the private field directly, bypassing the public setter. This causes an exception, if the application runs as untrusted code, e.g. as an unsigned applet, because private field access is restricted.
> Desired behaviour: call the public setter if it exists, and fall back to setting the private field directly only if the setter hasn't been defined. This would be also consistent with other frameworks such as Hibernate or Spring, which use setters and getters to set and get property values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira