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.

Bug 257808

Summary: com.sun.tools.classfile.ConstantPool$InvalidEntry: unexpected tag at #1: 67
Product: java Reporter: vicricker <vicricker>
Component: SourceAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 222343
Attachments: stacktrace

Description vicricker 2016-02-01 19:19:00 UTC
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)
Comment 1 vicricker 2016-02-01 19:19:01 UTC
Created attachment 158343 [details]
stacktrace
Comment 2 vicricker 2016-02-01 19:43:59 UTC
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)
Comment 3 Svata Dedic 2016-04-25 14:38:11 UTC
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.