From 6838d3593512d0388948c784023303d966b6e298 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 13 Oct 2012 18:07:27 -0700 Subject: gluegen: simplify expression comparing against Boolean.TRUE As a last resort we can just return the boolean value directly here, also no need to try/catch as valueOf does not throw any exceptions. Pointed out by Findbugs. Signed-off-by: Harvey Harrison --- src/java/com/jogamp/gluegen/pcpp/PCPP.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/java/com/jogamp/gluegen/pcpp/PCPP.java b/src/java/com/jogamp/gluegen/pcpp/PCPP.java index 07c7bd3..30d8dd8 100644 --- a/src/java/com/jogamp/gluegen/pcpp/PCPP.java +++ b/src/java/com/jogamp/gluegen/pcpp/PCPP.java @@ -961,13 +961,8 @@ public class PCPP { // ok, it's not a valid decimal value, try hex/octal value return Long.parseLong(word) != 0; } catch (NumberFormatException nfe2) { - try { - // ok, it's not a valid hex/octal value, try boolean - return Boolean.valueOf(word) == Boolean.TRUE; - } catch (NumberFormatException nfe3) { - // give up; the symbol isn't a numeric or boolean value - return false; - } + // ok, it's not a valid hex/octal value, try boolean last + return Boolean.valueOf(word).booleanValue(); } } } -- cgit v1.2.3