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.
This bug was originally marked as duplicate of bug 229629, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 8.1 (Build 201510222201) VM: OpenJDK 64-Bit Server VM, 25.71-b15, OpenJDK Runtime Environment, 1.8.0_71-b15 OS: Linux User Comments: vicricker: A PHP project that I'm working on uses the naming convention of *.class for PHP classes. Looks like NetBeans is trying to open them as Java Class files, and failing. Stacktrace: com.sun.tools.classfile.ConstantPool$InvalidEntry: unexpected tag at #1: 67 at com.sun.tools.classfile.ConstantPool.<init>(ConstantPool.java:231) at com.sun.tools.classfile.ClassFile.<init>(ClassFile.java:82) at com.sun.tools.classfile.ClassFile.read(ClassFile.java:69) at org.netbeans.modules.java.classfile.CodeGenerator$TreeBuilder.visitType(CodeGenerator.java:303) at org.netbeans.modules.java.classfile.CodeGenerator$TreeBuilder.visitType(CodeGenerator.java:270) at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:1180)
Created attachment 158343 [details] stacktrace
As a workaround, you can set the file association for class files to text/x-php5. Options/Miscellaneous/Files/File Associations Select 'class' from 'File Extension' Set 'Associated File Type (MIME)' to text/x-php5 (or other)
I see it as a relative corner case (with a workaround possible through a configuration). Mime resolution for application/x-class-file COULD possibly look for the magic header 0xcafebabe, but this would imply an overall performance impact in java projects.