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

Vladimir Ozerov edited comment on IGNITE-2693 at 3/4/16 8:27 AM:
-----------------------------------------------------------------

Anton, Oddo,

I suppose {{ctx.kernalContext().config().getMarshaller()}} can never be 
{{null}} in started grid. See {{IgnitionEx.initializeConfiguration}} method - 
it sets default marshaller if it is not set by user. As such, there is no need 
to check {{ctx.kernalContext().config().getMarshaller() == null}} as it always 
will be {{false}}.

Next, I do not quite understand what kind of class-casts should be tested. If 
user calls {{keepBinary()}} then he expects binary objects. But without 
{{BinaryMarshaller}} we cannot produce them. Therefore, an *exception* should 
be thrown in this case to indicate user that we cannot server his intent. If we 
do so, there is no need to check for any class-casts. Instead, we should simply 
wrote a test which will ensure that proper exception is thrown.

Thoughts?


was (Author: vozerov):
Anton, Oddo,

I suppose {{ctx.kernalContext().config().getMarshaller()}} can never be 
{{null}} in started grid. See {{IgnitionEx.initializeConfiguration}} method - 
it sets default marshaller if it is not set by user. As such, there is no need 
to check {{ctx.kernalContext().config().getMarshaller() == null}} as it always 
will be {{false}}.

Next, I do not quite understand what kind of class-casts should be tested. If 
user calls "keepBinary()" then he expects binary objects. But without 
BinaryMarshaller we cannot produce them. Therefore, an *exception* should be 
thrown in this case to indicate user that we cannot server his intent. If we do 
so, there is no need to check for any class-casts. Instead, we should simply 
wrote a test which will ensure that proper exception is thrown.

Thoughts?

> withKeepBinary and non-binary marshallers
> -----------------------------------------
>
>                 Key: IGNITE-2693
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2693
>             Project: Ignite
>          Issue Type: Bug
>          Components: general
>            Reporter: Sergey Kozlov
>            Assignee: Oddo
>              Labels: newbie
>             Fix For: 1.6
>
>
> Currently the user is able to set {{.withKeepBinary()}} for any used 
> marshaller. But it obviously causes ClassCastException for non-binary 
> marshallers and should be available only for binary marshaller.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to