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

Andrew Wang commented on HADOOP-12895:
--------------------------------------

Hi Wei-chiu, good spot here, do you think it's better to make the message say 
"Factory is not in <x> mode" or "Factory is not in <x> mode. Actual mode is 
<y>". so it matches up with the logic of the if check? We may never add another 
Mode to the enum, but it seems like good practice.

> SSLFactory#createSSLSocketFactory exception message is wrong
> ------------------------------------------------------------
>
>                 Key: HADOOP-12895
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12895
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.0.2-alpha
>            Reporter: Wei-Chiu Chuang
>            Assignee: Wei-Chiu Chuang
>            Priority: Trivial
>         Attachments: HADOOP-12895.001.patch, HADOOP-12895.002.patch
>
>
> If in SERVER model, the following code should throw exception indicating 
> Factory is in SERVER mode, not in CLIENT mode. Otherwise, it could be 
> confusing.
> {code:title=SSLSocketFactory.java}
> public SSLSocketFactory createSSLSocketFactory()
>     throws GeneralSecurityException, IOException {
>     if (mode != Mode.CLIENT) {
>       throw new IllegalStateException("Factory is in CLIENT mode");
>     }
>     return context.getSocketFactory();
>   }
> {code}



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

Reply via email to