
findbugs - issue #35
Impossible cast from javax.naming.CompositeName to com.sun.jndi.dns.DnsName in addAll(int, Name) in DnsName.java
Bug report generated from FindBugs Impossible cast from javax.naming.CompositeName to com.sun.jndi.dns.DnsName in addAll(int, Name)
In class com.sun.jndi.dns.DnsName In method addAll(int, Name) Actual type javax.naming.CompositeName Expected com.sun.jndi.dns.DnsName Value loaded from n At DnsName.java:[line 363]
Relevant source code: 359: domain = null; 360: } 361: 362: } else if (n instanceof CompositeName) { 363: n = (DnsName) n; // force ClassCastException
Classified as: MOSTLY_HARMLESS Bug pattern explanation: This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime.
FindBugs issue identifier (do not modify or remove): 9f539f18993066f5fa629c57f23a982c
Comment #1
Posted on Jun 16, 2010 by Happy Giraffe(No comment was entered for this change.)
Status: Invalid
Labels:
FindBugsGenerated