You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by bu...@apache.org on 2007/03/09 00:06:37 UTC
DO NOT REPLY [Bug 41795] New: - ClassParser throws unintelligible Exception
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41795>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41795
Summary: ClassParser throws unintelligible Exception
Product: BCEL
Version: unspecified
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: Main
AssignedTo: bcel-dev@jakarta.apache.org
ReportedBy: ian988@darwinsys.com
o.a.b.classfile.ClassParser throws two exceptions. One has the file_name
variable included but the one that only comes up when you have a corrupted class
file does not. When you have thousands and thousands of classes (counting all
the classes in dependent jars) in a large project, this can make it very
difficult to find the problem!
One could in theory argue that the application using BCEL should report this,
but the canonical example of a file-related problem is FileNotFoundException
which does include the filename, for the same reason as I suggest the exception
thrown by ClassParser does. E.g., create new FileReader("/nosuchfile") and you get:
Exception in thread "main" java.io.FileNotFoundException: /nosuchfile (No such
file or directory)
A simple SVN patch against r516101 follows (bigger than it needs to be due to
Eclipse's auto-remove-excess-whitespace mode):
Index:
/home/ian/workspace/bcel/src/main/java/org/apache/bcel/classfile/ClassParser.java
===================================================================
---
/home/ian/workspace/bcel/src/main/java/org/apache/bcel/classfile/ClassParser.java
(revision 516101)
+++
/home/ian/workspace/bcel/src/main/java/org/apache/bcel/classfile/ClassParser.java
(working copy)
@@ -38,7 +38,7 @@
* further details about the structure of a bytecode file.
*
* @version $Id$
- * @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
+ * @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
*/
public final class ClassParser {
@@ -206,7 +206,8 @@
}
if (((access_flags & Constants.ACC_ABSTRACT) != 0)
&& ((access_flags & Constants.ACC_FINAL) != 0)) {
- throw new ClassFormatException("Class can't be both final and
abstract");
+ throw new ClassFormatException(
+ "Class " + file_name + " can't be both final and abstract");
}
class_name_index = file.readUnsignedShort();
superclass_name_index = file.readUnsignedShort();
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 41795] - ClassParser throws unintelligible Exception
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41795>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=41795
tcurdt@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From tcurdt@apache.org 2007-03-10 06:51 -------
Thanks, applied. Please attach the diff next time.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org