java - Why is this "if" a "dead code"? -



java - Why is this "if" a "dead code"? -

i have next code :

/** width of each brick in pixels */ private static final int brick_width = 11; /** width of each brick in pixels */ private static final int brick_height = 12; /** number of bricks in base of operations of pyramid */ private static final int bricks_in_base = 14; public void run () { int lowerleftside; if (brick_width / 2 == 0) { lowerleftside = ((getwidth()/2) - (brick_width*(bricks_in_base/2))); }else lowerleftside = ((getwidth()/2) - (brick_width*(bricks_in_base/2-1)));

eclipse marks whole if dead code. initialize value @ origin of run method.

thanks.

looks brick_width constant, brick_width/2 known @ compile time , eclipse knows path taken, other 1 dead code.

java

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -