Implemented Device parser by KostyaSha · Pull Request #593 · docker-java/docker-java

@KostyaSha

fixes #592


This change is Reviewable

@KostyaSha KostyaSha changed the title Implemented Device parser WIP Implemented Device parser

Jun 6, 2016

@codecov-io

Current coverage is 30.29%

Merging #593 into master will increase coverage by 7.45%

  1. 3 files (not in diff) in ...erjava/netty/handler were modified. more
    • Misses -19
    • Partials -2
    • Hits +21
  2. 17 files (not in diff) in ...ockerjava/netty/exec were modified. more
    • Misses -36
    • Hits +36
  3. 3 files (not in diff) in ...hub/dockerjava/netty were modified. more
    • Misses -17
    • Hits +17
  4. 5 files (not in diff) in ...kerjava/jaxrs/filter were modified. more
    • Misses -23
    • Hits +23
  5. 2 files (not in diff) in ...java/jaxrs/connector were modified. more
    • Misses -49
    • Hits +49
  6. 22 files (not in diff) in ...hub/dockerjava/jaxrs were modified. more
    • Misses -66
    • Hits +66
  7. 5 files (not in diff) in ...dockerjava/core/util were modified. more
    • Misses -17
    • Partials -6
    • Hits +23
  8. 2 files (not in diff) in ...java/core/dockerfile were modified. more
    • Misses -16
    • Partials -11
    • Hits +27
  9. 12 files (not in diff) in ...kerjava/core/command were modified. more
    • Misses -34
    • Partials -6
    • Hits +40
  10. 3 files (not in diff) in ...ockerjava/core/async were modified. more
    • Misses -5
    • Partials -2
    • Hits +7
@@             master       #593   diff @@
==========================================
  Files           296        296          
  Lines          6218       6245    +27   
  Methods           0          0          
  Messages          0          0          
  Branches        547        553     +6   
==========================================
+ Hits           1420       1892   +472   
+ Misses         4706       4353   -353   
+ Partials         92          0    -92   

Powered by Codecov. Last updated by 3a33182...430a576

@KostyaSha KostyaSha changed the title WIP Implemented Device parser Implemented Device parser

Jun 7, 2016

@KostyaSha

Todo implement validator, but i have no time and daemon error would return error.

@KostyaSha

@KostyaSha

Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>

marcuslinke

* @link https://github.com/docker/docker/blob/6b4a46f28266031ce1a1315f17fb69113a06efe1/runconfig/opts/parse.go#L796
*/
private static boolean validDeviceMode(String deviceMode) {
Map<String, Boolean> validModes = new HashMap<>(3);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The `validModes' map should be declared as static member and not declared inline.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean under not declared inline.?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean it should be declared at the class level not in the method itself.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It must be mutable, it changes true to false to exclude double letters.

@KostyaSha

@marcuslinke updated, feel free to squash merge (dropdown in merge button) if it LGTY.

@KostyaSha

panuse pushed a commit to TuKangTech/docker-java that referenced this pull request

Aug 20, 2017
* Implement Device parser

Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>

* Add more tests, fix.