File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed
modules/binary/api/src/main/java/org/apache/ignite/internal/binary Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -323,12 +323,7 @@ private <T> T uncachedValue(Class<?> cls) throws BinaryObjectException {
323323
324324 /** {@inheritDoc} */
325325 @ Override public byte [] valueBytes (CacheObjectValueContext cacheCtx ) throws IgniteCheckedException {
326- if (valBytes != null )
327- return valBytes ;
328-
329- valBytes = Marshallers .marshal (ctx .marshaller (), this );
330-
331- return valBytes ;
326+ return valueBytes ();
332327 }
333328
334329 /** {@inheritDoc} */
@@ -382,15 +377,21 @@ private <T> T uncachedValue(Class<?> cls) throws BinaryObjectException {
382377
383378 /** {@inheritDoc} */
384379 @ Override public int size () {
385- if (valBytes == null ) {
386- try {
387- valBytes = Marshallers .marshal (ctx .marshaller (), this );
388- }
389- catch (IgniteCheckedException e ) {
390- throw CommonUtils .convertException (e );
391- }
380+ try {
381+ return valueBytes ().length ;
382+ }
383+ catch (IgniteCheckedException e ) {
384+ throw CommonUtils .convertException (e );
392385 }
386+ }
387+
388+ /** */
389+ private byte [] valueBytes () throws IgniteCheckedException {
390+ if (valBytes != null )
391+ return valBytes ;
392+
393+ valBytes = Marshallers .marshal (ctx .marshaller (), this );
393394
394- return BinaryPrimitives . readInt ( valBytes , ord + GridBinaryMarshaller . TOTAL_LEN_POS ) ;
395+ return valBytes ;
395396 }
396397}
You can’t perform that action at this time.
0 commit comments