You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "c keller (JIRA)" <ji...@apache.org> on 2006/05/03 15:39:46 UTC

[jira] Created: (JCR-424) PropertyState binary type desirialsation only returns half of content

PropertyState binary type desirialsation only returns half of content
---------------------------------------------------------------------

         Key: JCR-424
         URL: http://issues.apache.org/jira/browse/JCR-424
     Project: Jackrabbit
        Type: Bug

  Components: core  
    Versions: 1.0    
 Environment: Jackrabbit checkout revision 399293
    Reporter: c keller
    Priority: Minor


Create a PropertyState for a binary Property (e.g jcr:data) set a value larger than the BLOBFileValues#MAX_BUFFER_SIZE  (e.g. 300Kbyte) serialse it.
On deserialisation the resulting PropertyState's InternalValue's size is only half as the origianl (e.g. 150Kbyte)

Most probably this is due to the States InputStream implementation marking bytes twice to be read.
Following fix solves the issue for call to #read(byte[], in, int),
but other Stream methods may fail as well.

Index: jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java
===================================================================
--- jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (revision 399293)
+++ jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (working  copy)
@@ -305,7 +305,6 @@
                                 len = (int) (length - consumed);
                             }
                             int read = super.read(b, off, len);
-                            consumed += read;
                             return read;
                         }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-424) PropertyState binary type desirialsation only returns half of content

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-424?page=comments#action_12413412 ] 

Jukka Zitting commented on JCR-424:
-----------------------------------

Merged for 1.0.1 in revision 409611.

> PropertyState binary type desirialsation only returns half of content
> ---------------------------------------------------------------------
>
>          Key: JCR-424
>          URL: http://issues.apache.org/jira/browse/JCR-424
>      Project: Jackrabbit
>         Type: Bug

>   Components: core
>     Versions: 1.0
>  Environment: Jackrabbit checkout revision 399293
>     Reporter: c keller
>     Assignee: Stefan Guggisberg
>     Priority: Minor
>      Fix For: 1.0.1

>
> Create a PropertyState for a binary Property (e.g jcr:data) set a value larger than the BLOBFileValues#MAX_BUFFER_SIZE  (e.g. 300Kbyte) serialse it.
> On deserialisation the resulting PropertyState's InternalValue's size is only half as the origianl (e.g. 150Kbyte)
> Most probably this is due to the States InputStream implementation marking bytes twice to be read.
> Following fix solves the issue for call to #read(byte[], in, int),
> but other Stream methods may fail as well.
> Index: jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java
> ===================================================================
> --- jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (revision 399293)
> +++ jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (working  copy)
> @@ -305,7 +305,6 @@
>                                  len = (int) (length - consumed);
>                              }
>                              int read = super.read(b, off, len);
> -                            consumed += read;
>                              return read;
>                          }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (JCR-424) PropertyState binary type desirialsation only returns half of content

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-424?page=all ]
     
Stefan Guggisberg resolved JCR-424:
-----------------------------------

    Fix Version: 1.0.1
     Resolution: Fixed

fixed in svn r399332. thanks for reporting this issue!

> PropertyState binary type desirialsation only returns half of content
> ---------------------------------------------------------------------
>
>          Key: JCR-424
>          URL: http://issues.apache.org/jira/browse/JCR-424
>      Project: Jackrabbit
>         Type: Bug

>   Components: core
>     Versions: 1.0
>  Environment: Jackrabbit checkout revision 399293
>     Reporter: c keller
>     Assignee: Stefan Guggisberg
>     Priority: Minor
>      Fix For: 1.0.1

>
> Create a PropertyState for a binary Property (e.g jcr:data) set a value larger than the BLOBFileValues#MAX_BUFFER_SIZE  (e.g. 300Kbyte) serialse it.
> On deserialisation the resulting PropertyState's InternalValue's size is only half as the origianl (e.g. 150Kbyte)
> Most probably this is due to the States InputStream implementation marking bytes twice to be read.
> Following fix solves the issue for call to #read(byte[], in, int),
> but other Stream methods may fail as well.
> Index: jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java
> ===================================================================
> --- jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (revision 399293)
> +++ jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (working  copy)
> @@ -305,7 +305,6 @@
>                                  len = (int) (length - consumed);
>                              }
>                              int read = super.read(b, off, len);
> -                            consumed += read;
>                              return read;
>                          }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (JCR-424) PropertyState binary type desirialsation only returns half of content

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-424?page=all ]

Stefan Guggisberg reassigned JCR-424:
-------------------------------------

    Assign To: Stefan Guggisberg

> PropertyState binary type desirialsation only returns half of content
> ---------------------------------------------------------------------
>
>          Key: JCR-424
>          URL: http://issues.apache.org/jira/browse/JCR-424
>      Project: Jackrabbit
>         Type: Bug

>   Components: core
>     Versions: 1.0
>  Environment: Jackrabbit checkout revision 399293
>     Reporter: c keller
>     Assignee: Stefan Guggisberg
>     Priority: Minor

>
> Create a PropertyState for a binary Property (e.g jcr:data) set a value larger than the BLOBFileValues#MAX_BUFFER_SIZE  (e.g. 300Kbyte) serialse it.
> On deserialisation the resulting PropertyState's InternalValue's size is only half as the origianl (e.g. 150Kbyte)
> Most probably this is due to the States InputStream implementation marking bytes twice to be read.
> Following fix solves the issue for call to #read(byte[], in, int),
> but other Stream methods may fail as well.
> Index: jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java
> ===================================================================
> --- jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (revision 399293)
> +++ jackrabbit/java/org/apache/jackrabbit/core/state/PropertyState.java (working  copy)
> @@ -305,7 +305,6 @@
>                                  len = (int) (length - consumed);
>                              }
>                              int read = super.read(b, off, len);
> -                            consumed += read;
>                              return read;
>                          }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira