Conditions with that always returns true is 'if' necessary?

Otávio Gonçalves de Santana otaviopolianasantana at gmail.com
Mon Apr 21 12:58:32 UTC 2014


Hello everyone, one question.
Conditions that always returns true, is 'if' necessary?
I found one.

diff -r 57c1da89ae1a
src/share/classes/java/lang/invoke/BoundMethodHandle.java
--- a/src/share/classes/java/lang/invoke/BoundMethodHandle.java Wed Apr 16
12:32:36 2014 -0700
+++ b/src/share/classes/java/lang/invoke/BoundMethodHandle.java Mon Apr 21
09:50:29 2014 -0300
@@ -66,8 +66,7 @@
         try {
             switch (xtype) {
             case 'L':
-                if (true)  return bindSingle(type, form, x);  // Use known
fast path.
-                return (BoundMethodHandle)
SpeciesData.EMPTY.extendWithType('L').constructor[0].invokeBasic(type,
form, x);
+                return bindSingle(type, form, x);  // Use known fast path.
             case 'I':
                 return (BoundMethodHandle)
SpeciesData.EMPTY.extendWithType('I').constructor[0].invokeBasic(type,
form, ValueConversions.widenSubword(x));
             case 'J':



-- 
Atenciosamente.

Otávio Gonçalves de Santana

blog:     http://otaviosantana.blogspot.com.br/
twitter: http://twitter.com/otaviojava
site:     http://www.otaviojava.com.br
(11)     98255-3513



More information about the core-libs-dev mailing list