Apologies in advance but I have never seen this error before and don\'t know what to include. I am using NetBeans and suddenly began getting this error:
Exc
Verified: Compiler Bug.
I would seriously doubt that this is a Java compiler bug. Something like that would most likely have been noticed by someone else and reported as a bug. But you can verify this by recompiling the file and using javap
to disassemble the bytecodes. Look for the the following instruction in the constructor code:
invokespecial #1 <Method java.lang.Object()>
I think it is more likely that something is modifying the bytecodes after the compiler has written them. Possibilities include some profiler that is modifying the bytecodes to inject profiling hooks, or some annotation processor that is injecting dependencies, cut points, etc.
This happened to me in Netbeans. In netbeans, when you try to copy a .java file in same directory without "refactor copy", it places the new file as "YourJavaFile_1.java" and problem occures. But if you copy that file with "refactor copy", there is no problem.
It gives the name as "YourJavaFile1.java", but with refactoring.
Just try putting a super()
at the beginning of your constructor as the error states.
I thought it was usually inferred and added without the constraint to write it, maybe the superclass of CostOperations
doesn't have any empty constructor..
It is definitely a compiler issue: the bytecode generated has a different Binary Format.
To solve this: Right click on the project -> Properties -> Sources -> Source/Binary Format
Change it to whatever format is suitable to your code.
I opine it may be caused as a result in class/constructor access specifier mismatch. I just resolved a similar issue where the class was declared with a package access specifier but its constructor was declared public.
Simply making the constructor also have a package access specifier resolved the issue.
class Ngram{
public Ngram(String str, int count){
ngram = str;
freq = count;
}
String ngram;
int freq;
}