From 6314138afd5f90d2f32f30c4a6210155abe69820 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 5 Sep 2014 04:37:52 +0200 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libgamma/CRTCInformation.java | 44 ++++++++++++++++++++++++++------------- src/libgamma/Site.java | 2 +- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/libgamma/CRTCInformation.java b/src/libgamma/CRTCInformation.java index 532e984..a54a0c0 100644 --- a/src/libgamma/CRTCInformation.java +++ b/src/libgamma/CRTCInformation.java @@ -481,6 +481,22 @@ public class CRTCInformation public final boolean has_error; + + /** + * Helper function for {@link #toString}. + * + * @param error An error, may be {@code null}. + * @return A textual representation of error + */ + private static String errorToString(LibgammaException error) + { + if (error == null) + return ""; + else + return error.toString(); + } + + /** * {@inheritDoc} */ @@ -492,35 +508,35 @@ public class CRTCInformation return "" : this.connector_name) + ", " + + "connector_name_error = " + errorToString(this.connector_name_error) + ", " + "connector_type = " + this.connector_type.toString() + ", " + - "connector_type_error = " + this.connector_type_error.toString() + ", " + + "connector_type_error = " + errorToString(this.connector_type_error) + ", " + "gamma_red = " + Float.toString(this.gamma_red) + ", " + "gamma_green = " + Float.toString(this.gamma_green) + ", " + "gamma_blue = " + Float.toString(this.gamma_blue) + ", " + - "gamma_error = " + this.gamma_error.toString() + ", " + + "gamma_error = " + errorToString(this.gamma_error) + ", " + "has_error = " + Boolean.toString(this.has_error) + ">"; } diff --git a/src/libgamma/Site.java b/src/libgamma/Site.java index a23ce29..2dbe2b3 100644 --- a/src/libgamma/Site.java +++ b/src/libgamma/Site.java @@ -117,7 +117,7 @@ public class Site public String toString() { return "" : this.site) + ", " + + "site = " + (this.site == null ? "(null)" : this.site) + ", " + "partitions_available = " + Integer.toString(this.partitions_available) + ">"; } -- cgit v1.2.3-70-g09d2