This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When the ClassUpdater finds a file that ends in ".class" but isn't a valid Java class file, it logs a long, scary exception. Exceptions are supposed to be used for occasional occurrences, but we cannot assume that the content of all files whose names end in ".class" are guaranteed to be Java files. At most, a "invalid class file: <filename>" message should be logged instead of the exception. To recreate, copy any data file to something like "foo.class" in a project directory to create a bad class file. Suggested fix: the classfile module can define an InvalidClassFormatException which extends IOException, and throw that for those cases where it detects a bad class format. ClassUpdater can separately catch this exception, and either log the bad file by name, or ignore it. This way, real IOExceptions (bad disk, etc.) can still be logged. I'd be happy to make these changes.
Created attachment 17672 [details] Exception thrown when scanning the bad foo.class file.
Added InvalidClassFileException to classfile, which is thrown for badly formatted classes, then added catch for this exception in ClassUpdater. This allows true IOExceptions to still be reported.
Reorganization of java component