Skip to content

Commit

Permalink
MET-6262 add switch case when ColorSpace is null (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeortizquan authored Dec 2, 2024
1 parent 1c99afa commit 43cf962
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ public int getCode() {
* @return The category, or null if none of the categories apply.
*/
public static ImageColorSpace categorizeImageColorSpace(final ColorSpace colorSpace) {
return switch (colorSpace) {
case ColorSpace.COLOR -> ImageColorSpace.COLOR;
case ColorSpace.GRAYSCALE -> ImageColorSpace.GRAYSCALE;
case ColorSpace.OTHER -> ImageColorSpace.OTHER;
};
return switch (colorSpace) {
case null -> null;
case ColorSpace.COLOR -> ImageColorSpace.COLOR;
case ColorSpace.GRAYSCALE -> ImageColorSpace.GRAYSCALE;
case ColorSpace.OTHER -> ImageColorSpace.OTHER;
};
}

/**
Expand Down

0 comments on commit 43cf962

Please sign in to comment.