From 815776c5760e42c8b3c858a9bab982b203c59c24 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 8 Jul 2014 21:13:15 +0200 Subject: Findbugs: Remove branches where reference cannot be null --- src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/util') diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java index 4a3e5b2e1..29dce40f5 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java @@ -551,7 +551,7 @@ public class ShaderCode { out.println(""); return; } - final int sourceCount = (null!=shaderSource)?shaderSource.length:0; + final int sourceCount = shaderSource.length; final int shaderCount = (null!=shader)?shader.capacity():0; for(int i=0; ishaderIdx || shaderIdx>=shaderCount) { throw new IndexOutOfBoundsException("shaderIdx not within shader bounds [0.."+(shaderCount-1)+"]: "+shaderIdx); } - final int sourceCount = (null!=shaderSource)?shaderSource.length:0; + final int sourceCount = shaderSource.length; if(shaderIdx>=sourceCount) { throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx); } @@ -660,7 +660,7 @@ public class ShaderCode { final int oldNameLen = oldName.length(); final int newNameLen = newName.length(); int num = 0; - final int sourceCount = (null!=shaderSource)?shaderSource.length:0; + final int sourceCount = shaderSource.length; for(int shaderIdx = 0; shaderIdxshaderIdx || shaderIdx>=shaderCount) { throw new IndexOutOfBoundsException("shaderIdx not within shader bounds [0.."+(shaderCount-1)+"]: "+shaderIdx); } - final int sourceCount = (null!=shaderSource)?shaderSource.length:0; + final int sourceCount = shaderSource.length; if(shaderIdx>=sourceCount) { throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx); } -- cgit v1.2.3