> On April 19, 2016, 5:58 a.m., Vinod Kone wrote:
> > can you also update cli/execute.cpp, examples/test_http_framework.cpp, 
> > examples/long_lived_framework.cpp, master/validation.cpp, master/http.cpp, 
> > master/master.cpp, slave/http.cpp, slave/validation.cpp and slave/http.cpp?
> > 
> > make sure to grep through the code base to catch all other cases where 
> > switch over an enum uses a "default".
> 
> Yong Tang wrote:
>     Thanks Vinod for the review. I just updated the listed files.
> 
> Yong Tang wrote:
>     Oh I noticed there are 54 other instances of "default:" (e.g., 
> src/slave/slave.cpp). I will rework on the review request.
> 
> Yong Tang wrote:
>     Hi Ben/Vinod,
>     
>     I take a second look at this issue and I am not so sure about the scope. 
> Is the goal of this task to replace/remove ALL usages of `default:` in switch 
> statement, or this taks is to replace only Event/Call related ones with 
> 'UNKNOWN'? For example, I saw the usage of the following in 
> src/docker/docker.cpp:
>     
>     ```
>           if (volume.has_mode()) {
>             switch (volume.mode()) {
>               case Volume::RW: volumeConfig += ":rw"; break;
>               case Volume::RO: volumeConfig += ":ro"; break;
>               default: return Failure("Unsupported volume mode");
>             }
>           }
>     ```
>     I am not sure if we should remove the "default:" line in the above or not.
>     
>     Let me know which way is the preferred way and I will update the review 
> request.
> 
> Vinod Kone wrote:
>     Just Event/Call in this review. And perhaps AuthZ Action in another 
> review.

Thanks Vinod. The review request has been updated. I used grep and it should 
have covered all Event/Call enum types. I also create another review request  
https://reviews.apache.org/r/46470/ to cover authorization enum types. Let me 
know if there are any issues.


- Yong


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46364/#review129486
-----------------------------------------------------------


On April 21, 2016, 2:28 a.m., Yong Tang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46364/
> -----------------------------------------------------------
> 
> (Updated April 21, 2016, 2:28 a.m.)
> 
> 
> Review request for mesos, Adam B, Ben Mahler, and Vinod Kone.
> 
> 
> Bugs: MESOS-5014 and MESOS-5015
>     https://issues.apache.org/jira/browse/MESOS-5014
>     https://issues.apache.org/jira/browse/MESOS-5015
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch changes from `default` statement to explicit case
> statement (`UNKNOWN`) so that complier could help catching all
> switches when new enums are introduced in the future.
> 
> This patch is related to:
> https://reviews.apache.org/r/45317/ (MESOS-5014)
> https://reviews.apache.org/r/45304/ (MESOS-5015)
> 
> 
> Diffs
> -----
> 
>   src/cli/execute.cpp 087a73143d739f41638b8335c7e24dfcd14bc7fb 
>   src/examples/long_lived_executor.cpp 
> ebb9cbf578d79fd87ac51ea85575950b7c0a1504 
>   src/examples/long_lived_framework.cpp 
> c696ccb6b2ace6e047f6509b291dd14be240cf70 
>   src/examples/test_http_executor.cpp 
> ceb489d43f35d24c8a7f5fbb0148529745ee357a 
>   src/examples/test_http_framework.cpp 
> 8cc3107034d46cb6a2966835f509508223c6e674 
>   src/launcher/http_command_executor.cpp 
> ad484e0e6f5067b6c166111c91b1ff1e8c05d9ac 
>   src/master/http.cpp a9cb99a92ff5a783e719df5e5cfb6e8301241df9 
>   src/master/master.cpp 6dacf5fbd73771e5c31ffb0e8723cd2905dcefb3 
>   src/master/validation.cpp 0cd118ee4f89f749a063f6ba7f419d5a220dc1d4 
>   src/sched/sched.cpp 5393f0de655d03ac1a31b3144d4d764d4aeb56fb 
>   src/slave/http.cpp 3908e33ed5b233387790276f6f5d884452087d2c 
>   src/slave/validation.cpp ec1a4b6d9c55ab0c9894d5a49e290e15dee32c22 
>   src/tests/mesos.hpp e4b63d41d883807ac39846799468b80e88c84e0b 
> 
> Diff: https://reviews.apache.org/r/46364/diff/
> 
> 
> Testing
> -------
> 
> make check (Ubuntu 14.04)
> 
> 
> Thanks,
> 
> Yong Tang
> 
>

Reply via email to